aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/percpu.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-03-10 04:57:54 -0500
committerTejun Heo <tj@kernel.org>2010-03-29 10:07:12 -0400
commit10fad5e46f6c7bdfb01b1a012380a38e3c6ab346 (patch)
tree9ec6e3955e7f879f64ea79812cf5ecd41baa6939 /include/linux/percpu.h
parent259354deaaf03d49a02dbb9975d6ec2a54675672 (diff)
percpu, module: implement and use is_kernel/module_percpu_address()
lockdep has custom code to check whether a pointer belongs to static percpu area which is somewhat broken. Implement proper is_kernel/module_percpu_address() and replace the custom code. On UP, percpu variables are regular static variables and can't be distinguished from them. Always return %false on UP. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Ingo Molnar <mingo@redhat.com>
Diffstat (limited to 'include/linux/percpu.h')
-rw-r--r--include/linux/percpu.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index a93e5bfdccb8..11d5f834b54a 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -137,6 +137,7 @@ extern int __init pcpu_page_first_chunk(size_t reserved_size,
137extern void __percpu *__alloc_reserved_percpu(size_t size, size_t align); 137extern void __percpu *__alloc_reserved_percpu(size_t size, size_t align);
138extern void __percpu *__alloc_percpu(size_t size, size_t align); 138extern void __percpu *__alloc_percpu(size_t size, size_t align);
139extern void free_percpu(void __percpu *__pdata); 139extern void free_percpu(void __percpu *__pdata);
140extern bool is_kernel_percpu_address(unsigned long addr);
140extern phys_addr_t per_cpu_ptr_to_phys(void *addr); 141extern phys_addr_t per_cpu_ptr_to_phys(void *addr);
141 142
142#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA 143#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA
@@ -163,6 +164,12 @@ static inline void free_percpu(void __percpu *p)
163 kfree(p); 164 kfree(p);
164} 165}
165 166
167/* can't distinguish from other static vars, always false */
168static inline bool is_kernel_percpu_address(unsigned long addr)
169{
170 return false;
171}
172
166static inline phys_addr_t per_cpu_ptr_to_phys(void *addr) 173static inline phys_addr_t per_cpu_ptr_to_phys(void *addr)
167{ 174{
168 return __pa(addr); 175 return __pa(addr);