aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-02-02 00:38:57 -0500
committerTejun Heo <tj@kernel.org>2010-02-16 21:17:38 -0500
commit43cf38eb5cea91245502df3fcee4dbfc1c74dd1c (patch)
treea58ea87af1f07b8aed4941db074f44103f321f6e /kernel
parentab386128f20c44c458a90039ab1bdc265ac474c9 (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 'kernel')
-rw-r--r--kernel/kexec.c2
-rw-r--r--kernel/sched.c4
-rw-r--r--kernel/stop_machine.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c
index ef077fb73155..87ebe8adc474 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -41,7 +41,7 @@
41#include <asm/sections.h> 41#include <asm/sections.h>
42 42
43/* Per cpu memory for storing cpu states in case of system crash. */ 43/* Per cpu memory for storing cpu states in case of system crash. */
44note_buf_t* crash_notes; 44note_buf_t __percpu *crash_notes;
45 45
46/* vmcoreinfo stuff */ 46/* vmcoreinfo stuff */
47static unsigned char vmcoreinfo_data[VMCOREINFO_BYTES]; 47static unsigned char vmcoreinfo_data[VMCOREINFO_BYTES];
diff --git a/kernel/sched.c b/kernel/sched.c
index 3a8fb30a91b1..978edfd35a96 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1566,7 +1566,7 @@ static unsigned long cpu_avg_load_per_task(int cpu)
1566 1566
1567#ifdef CONFIG_FAIR_GROUP_SCHED 1567#ifdef CONFIG_FAIR_GROUP_SCHED
1568 1568
1569static __read_mostly unsigned long *update_shares_data; 1569static __read_mostly unsigned long __percpu *update_shares_data;
1570 1570
1571static void __set_se_shares(struct sched_entity *se, unsigned long shares); 1571static void __set_se_shares(struct sched_entity *se, unsigned long shares);
1572 1572
@@ -10683,7 +10683,7 @@ struct cgroup_subsys cpu_cgroup_subsys = {
10683struct cpuacct { 10683struct cpuacct {
10684 struct cgroup_subsys_state css; 10684 struct cgroup_subsys_state css;
10685 /* cpuusage holds pointer to a u64-type object on every cpu */ 10685 /* cpuusage holds pointer to a u64-type object on every cpu */
10686 u64 *cpuusage; 10686 u64 __percpu *cpuusage;
10687 struct percpu_counter cpustat[CPUACCT_STAT_NSTATS]; 10687 struct percpu_counter cpustat[CPUACCT_STAT_NSTATS];
10688 struct cpuacct *parent; 10688 struct cpuacct *parent;
10689}; 10689};
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index 912823e2a11b..9bb9fb1bd79c 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -45,7 +45,7 @@ static int refcount;
45static struct workqueue_struct *stop_machine_wq; 45static struct workqueue_struct *stop_machine_wq;
46static struct stop_machine_data active, idle; 46static struct stop_machine_data active, idle;
47static const struct cpumask *active_cpus; 47static const struct cpumask *active_cpus;
48static void *stop_machine_work; 48static void __percpu *stop_machine_work;
49 49
50static void set_state(enum stopmachine_state newstate) 50static void set_state(enum stopmachine_state newstate)
51{ 51{