diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-08-03 01:08:48 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2009-08-03 12:28:52 -0400 |
commit | ed8d9adf357ec331603fa1049510399812cea7e5 (patch) | |
tree | cc6eae948bf4652b9d87aee796ae78cc6287ac36 /arch/x86/include/asm/thread_info.h | |
parent | a33a052f19a21d727847391c8c1aff3fb221c472 (diff) |
x86, percpu: Add 'percpu_read_stable()' interface for cacheable accesses
This is very useful for some common things like 'get_current()' and
'get_thread_info()', which can be used multiple times in a function, and
where the result is cacheable.
tj: Added the magical undocumented "P" modifier to UP __percpu_arg()
to force gcc to dereference the pointer value passed in via the
"p" input constraint. Without this, percpu_read_stable() returns
the address of the percpu variable. Also added comment explaining
the difference between percpu_read() and percpu_read_stable().
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/include/asm/thread_info.h')
-rw-r--r-- | arch/x86/include/asm/thread_info.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index fad7d40b75f..a1bb5a114bf 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h | |||
@@ -213,7 +213,7 @@ DECLARE_PER_CPU(unsigned long, kernel_stack); | |||
213 | static inline struct thread_info *current_thread_info(void) | 213 | static inline struct thread_info *current_thread_info(void) |
214 | { | 214 | { |
215 | struct thread_info *ti; | 215 | struct thread_info *ti; |
216 | ti = (void *)(percpu_read(kernel_stack) + | 216 | ti = (void *)(percpu_read_stable(kernel_stack) + |
217 | KERNEL_STACK_OFFSET - THREAD_SIZE); | 217 | KERNEL_STACK_OFFSET - THREAD_SIZE); |
218 | return ti; | 218 | return ti; |
219 | } | 219 | } |