diff options
author | Tejun Heo <tj@kernel.org> | 2010-02-02 00:38:57 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-02-16 21:17:38 -0500 |
commit | 43cf38eb5cea91245502df3fcee4dbfc1c74dd1c (patch) | |
tree | a58ea87af1f07b8aed4941db074f44103f321f6e /include/linux | |
parent | ab386128f20c44c458a90039ab1bdc265ac474c9 (diff) |
percpu: add __percpu sparse annotations to core kernel subsystems
Add __percpu sparse annotations to core subsystems.
These annotations are to make sparse consider percpu variables to be
in a different address space and warn if accessed without going
through percpu accessors. This patch doesn't affect normal builds.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-mm@kvack.org
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Dipankar Sarma <dipankar@in.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Eric Biederman <ebiederm@xmission.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/blktrace_api.h | 4 | ||||
-rw-r--r-- | include/linux/genhd.h | 2 | ||||
-rw-r--r-- | include/linux/kexec.h | 2 | ||||
-rw-r--r-- | include/linux/mmzone.h | 2 | ||||
-rw-r--r-- | include/linux/module.h | 2 | ||||
-rw-r--r-- | include/linux/percpu_counter.h | 2 | ||||
-rw-r--r-- | include/linux/srcu.h | 2 |
7 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 3b73b9992b26..416bf62d6d46 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -150,8 +150,8 @@ struct blk_user_trace_setup { | |||
150 | struct blk_trace { | 150 | struct blk_trace { |
151 | int trace_state; | 151 | int trace_state; |
152 | struct rchan *rchan; | 152 | struct rchan *rchan; |
153 | unsigned long *sequence; | 153 | unsigned long __percpu *sequence; |
154 | unsigned char *msg_data; | 154 | unsigned char __percpu *msg_data; |
155 | u16 act_mask; | 155 | u16 act_mask; |
156 | u64 start_lba; | 156 | u64 start_lba; |
157 | u64 end_lba; | 157 | u64 end_lba; |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 9717081c75ad..56b50514ab25 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -101,7 +101,7 @@ struct hd_struct { | |||
101 | unsigned long stamp; | 101 | unsigned long stamp; |
102 | int in_flight[2]; | 102 | int in_flight[2]; |
103 | #ifdef CONFIG_SMP | 103 | #ifdef CONFIG_SMP |
104 | struct disk_stats *dkstats; | 104 | struct disk_stats __percpu *dkstats; |
105 | #else | 105 | #else |
106 | struct disk_stats dkstats; | 106 | struct disk_stats dkstats; |
107 | #endif | 107 | #endif |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index c356b6914ffd..03e8e8dbc577 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -199,7 +199,7 @@ extern struct kimage *kexec_crash_image; | |||
199 | */ | 199 | */ |
200 | extern struct resource crashk_res; | 200 | extern struct resource crashk_res; |
201 | typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4]; | 201 | typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4]; |
202 | extern note_buf_t *crash_notes; | 202 | extern note_buf_t __percpu *crash_notes; |
203 | extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; | 203 | extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; |
204 | extern size_t vmcoreinfo_size; | 204 | extern size_t vmcoreinfo_size; |
205 | extern size_t vmcoreinfo_max_size; | 205 | extern size_t vmcoreinfo_max_size; |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 7874201a3556..41acd4bf7664 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -301,7 +301,7 @@ struct zone { | |||
301 | unsigned long min_unmapped_pages; | 301 | unsigned long min_unmapped_pages; |
302 | unsigned long min_slab_pages; | 302 | unsigned long min_slab_pages; |
303 | #endif | 303 | #endif |
304 | struct per_cpu_pageset *pageset; | 304 | struct per_cpu_pageset __percpu *pageset; |
305 | /* | 305 | /* |
306 | * free areas of different sizes | 306 | * free areas of different sizes |
307 | */ | 307 | */ |
diff --git a/include/linux/module.h b/include/linux/module.h index 7e74ae0051cc..dd618eb026aa 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -365,7 +365,7 @@ struct module | |||
365 | 365 | ||
366 | struct module_ref { | 366 | struct module_ref { |
367 | int count; | 367 | int count; |
368 | } *refptr; | 368 | } __percpu *refptr; |
369 | #endif | 369 | #endif |
370 | 370 | ||
371 | #ifdef CONFIG_CONSTRUCTORS | 371 | #ifdef CONFIG_CONSTRUCTORS |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index a7684a513994..9bd103c844ee 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
@@ -21,7 +21,7 @@ struct percpu_counter { | |||
21 | #ifdef CONFIG_HOTPLUG_CPU | 21 | #ifdef CONFIG_HOTPLUG_CPU |
22 | struct list_head list; /* All percpu_counters are on a list */ | 22 | struct list_head list; /* All percpu_counters are on a list */ |
23 | #endif | 23 | #endif |
24 | s32 *counters; | 24 | s32 __percpu *counters; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | extern int percpu_counter_batch; | 27 | extern int percpu_counter_batch; |
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 4765d97dcafb..41eedccc962c 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
@@ -33,7 +33,7 @@ struct srcu_struct_array { | |||
33 | 33 | ||
34 | struct srcu_struct { | 34 | struct srcu_struct { |
35 | int completed; | 35 | int completed; |
36 | struct srcu_struct_array *per_cpu_ref; | 36 | struct srcu_struct_array __percpu *per_cpu_ref; |
37 | struct mutex mutex; | 37 | struct mutex mutex; |
38 | }; | 38 | }; |
39 | 39 | ||