diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 20:31:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 20:31:36 -0400 |
commit | 0fc0531e0a2174377a86fd6953ecaa00287d8f70 (patch) | |
tree | afe56978729300df96b002a064c9de927fadcfab /include/asm-generic | |
parent | 91b745016c12d440386c40fb76ab69c8e08cbc06 (diff) | |
parent | 9329ba9704f6bd51a735982e0d4a3eed72c3294f (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
percpu: update comments to reflect that percpu allocations are always zero-filled
percpu: Optimize __get_cpu_var()
x86, percpu: Optimize this_cpu_ptr
percpu: clear memory allocated with the km allocator
percpu: fix build breakage on s390 and cleanup build configuration tests
percpu: use percpu allocator on UP too
percpu: reduce PCPU_MIN_UNIT_SIZE to 32k
vmalloc: pcpu_get/free_vm_areas() aren't needed on UP
Fixed up trivial conflicts in include/linux/percpu.h
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/percpu.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index 08923b684768..d17784ea37ff 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h | |||
@@ -55,14 +55,18 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; | |||
55 | */ | 55 | */ |
56 | #define per_cpu(var, cpu) \ | 56 | #define per_cpu(var, cpu) \ |
57 | (*SHIFT_PERCPU_PTR(&(var), per_cpu_offset(cpu))) | 57 | (*SHIFT_PERCPU_PTR(&(var), per_cpu_offset(cpu))) |
58 | #define __get_cpu_var(var) \ | ||
59 | (*SHIFT_PERCPU_PTR(&(var), my_cpu_offset)) | ||
60 | #define __raw_get_cpu_var(var) \ | ||
61 | (*SHIFT_PERCPU_PTR(&(var), __my_cpu_offset)) | ||
62 | 58 | ||
63 | #define this_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, my_cpu_offset) | 59 | #ifndef __this_cpu_ptr |
64 | #define __this_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset) | 60 | #define __this_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset) |
61 | #endif | ||
62 | #ifdef CONFIG_DEBUG_PREEMPT | ||
63 | #define this_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, my_cpu_offset) | ||
64 | #else | ||
65 | #define this_cpu_ptr(ptr) __this_cpu_ptr(ptr) | ||
66 | #endif | ||
65 | 67 | ||
68 | #define __get_cpu_var(var) (*this_cpu_ptr(&(var))) | ||
69 | #define __raw_get_cpu_var(var) (*__this_cpu_ptr(&(var))) | ||
66 | 70 | ||
67 | #ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA | 71 | #ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA |
68 | extern void setup_per_cpu_areas(void); | 72 | extern void setup_per_cpu_areas(void); |