From: Paul Mackerras <paulus@samba.org>
To: Richard Henderson <rth@twiddle.net>,
t@twiddle.net, linux-kernel@vger.kernel.org,
linux-arch@vger.kernel.org, linuxppc-dev@ozlabs.org,
amodra@bigpond.net
Subject: Re: [RFC/PATCH] Make powerpc64 use __thread for per-cpu variables
Date: Thu, 11 May 2006 09:44:32 +1000 [thread overview]
Message-ID: <17506.31456.68099.57515@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <17506.29128.591758.502430@cargo.ozlabs.ibm.com>
I wrote:
> Hmmm... Would it be sufficient to use a RELOC_HIDE in __get_cpu_var,
> like this?
>
> #define __get_cpu_var(x) (*(RELOC_HIDE(&per_cpu__##x, 0)))
But that won't work because the compiler can still cache &per_cpu__x.
I guess I have to do this:
#define __get_cpu_var(var, cpu) \
(*(__typeof__(&per_cpu__##var))({ \
void *__ptr; \
asm("addi %0,13,per_cpu__"#var"@tprel" \
: "=r" (__ptr)); \
__ptr; \
}))
That means we lose the possible optimization of combining the addi
into a following load or store. Bah. However, I guess it's still
better than what we do at the moment.
Paul.
next prev parent reply other threads:[~2006-05-10 23:44 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
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 [this message]
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=17506.31456.68099.57515@cargo.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=amodra@bigpond.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=rth@twiddle.net \
--cc=t@twiddle.net \
/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).