linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Olof Johansson <olof@lixom.net>
To: Paul Mackerras <paulus@samba.org>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	linuxppc-dev@ozlabs.org
Subject: Re: [RFC/PATCH] Make powerpc64 use __thread for per-cpu variables
Date: Wed, 10 May 2006 00:16:50 -0500	[thread overview]
Message-ID: <20060510051649.GD1794@lixom.net> (raw)
In-Reply-To: <17505.26159.807484.477212@cargo.ozlabs.ibm.com>

On Wed, May 10, 2006 at 02:03:59PM +1000, Paul Mackerras wrote:
> With this patch, 64-bit powerpc uses __thread for per-cpu variables.

Nice! I like the way you hid the slb functions so they can't ever be
called by mistake from C code. :-)

This patch a ppc64_defconfig vmlinux a bit (with the other two percpu
patches):

olof@quad:~/work/linux/powerpc $ ls -l vmlinux.pre vmlinux
-rwxr-xr-x 1 olof olof 10290928 2006-05-09 23:48 vmlinux.pre
-rwxr-xr-x 1 olof olof 10307499 2006-05-09 23:50 vmlinux
olof@quad:~/work/linux/powerpc $ size vmlinux.pre vmlinux
   text    data     bss     dec     hex filename
5554034 2404256  480472 8438762  80c3ea vmlinux.pre
5578866 2384944  498848 8462658  812142 vmlinux

Looks like alot of the text growth is from the added mfsprg3 instructions:

$ objdump -d vmlinux.pre | egrep mfsprg.\*,3\$ | wc -l
26
$ objdump -d vmlinux | egrep mfsprg.\*,3\$ | wc -l
5134

... so, as the PACA gets deprecated, the bloat will go away again.

> The motivation for doing this is that getting the address of a per-cpu
> variable currently requires two loads (one to get our per-cpu offset
> and one to get the address of the variable in the .data.percpu
> section) plus an add.  With __thread we can get the address of our
> copy of a per-cpu variable with just an add (r13 plus a constant).

It would be interesting to see benchmarks of how much it improves
things. I guess it doesn't really get interesting until after the paca
gets removed though, due to the added mfsprg's.


-Olof

  reply	other threads:[~2006-05-10  5:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-10  4:03 [RFC/PATCH] Make powerpc64 use __thread for per-cpu variables Paul Mackerras
2006-05-10  5:16 ` Olof Johansson [this message]
2006-05-10  5:35   ` Alan Modra
2006-05-10  6:22   ` David S. Miller
2006-05-10  6:29   ` Paul Mackerras
2006-05-10  6:39     ` David S. Miller
2006-05-10  7:21       ` Benjamin Herrenschmidt
2006-05-10  7:41       ` Paul Mackerras
2006-05-10 10:14       ` David Howells
2006-05-10 15:47 ` Richard Henderson
2006-05-10 18:04   ` Steven Rostedt
2006-05-10 19:40   ` David S. Miller
2006-05-10 21:05     ` Paul Mackerras
2006-05-10 22:25       ` David S. Miller
2006-05-10 23:17       ` Segher Boessenkool
2006-05-11  0:22         ` Richard Henderson
2006-05-11 23:41           ` Segher Boessenkool
2006-05-11  1:04       ` Alan Modra
2006-05-11  1:21         ` Paul Mackerras
2006-05-11  2:01           ` Alan Modra
2006-05-11 23:42           ` Segher Boessenkool
2006-05-10 23:05   ` Paul Mackerras
2006-05-10 23:44     ` Paul Mackerras
2006-05-11  0:11       ` David S. Miller
2006-05-18 23:50         ` Paul Mackerras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060510051649.GD1794@lixom.net \
    --to=olof@lixom.net \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).