aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/lockdep.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-10-29 09:34:13 -0400
committerTejun Heo <tj@kernel.org>2009-10-29 09:34:13 -0400
commit1871e52c76dd95895caeb772f845a1718dcbcd75 (patch)
tree49e8148326f65353e673204f427bd4545eb26c16 /kernel/lockdep.c
parent0f5e4816dbf38ce9488e611ca2296925c1e90d5e (diff)
percpu: make percpu symbols under kernel/ and mm/ unique
This patch updates percpu related symbols under kernel/ and mm/ such that percpu symbols are unique and don't clash with local symbols. This serves two purposes of decreasing the possibility of global percpu symbol collision and allowing dropping per_cpu__ prefix from percpu symbols. * kernel/lockdep.c: s/lock_stats/cpu_lock_stats/ * kernel/sched.c: s/init_rq_rt/init_rt_rq_var/ (any better idea?) s/sched_group_cpus/sched_groups/ * kernel/softirq.c: s/ksoftirqd/run_ksoftirqd/a * kernel/softlockup.c: s/(*)_timestamp/softlockup_\1_ts/ s/watchdog_task/softlockup_watchdog/ s/timestamp/ts/ for local variables * kernel/time/timer_stats: s/lookup_lock/tstats_lookup_lock/ * mm/slab.c: s/reap_work/slab_reap_work/ s/reap_node/slab_reap_node/ * mm/vmstat.c: local variable changed to avoid collision with vmstat_work Partly based on Rusty Russell's "alloc_percpu: rename percpu vars which cause name clashes" patch. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: (slab/vmstat) Christoph Lameter <cl@linux-foundation.org> Reviewed-by: Christoph Lameter <cl@linux-foundation.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Ingo Molnar <mingo@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Nick Piggin <npiggin@suse.de>
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r--kernel/lockdep.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 3815ac1d58b2..8631320a50d0 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -140,7 +140,8 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
140} 140}
141 141
142#ifdef CONFIG_LOCK_STAT 142#ifdef CONFIG_LOCK_STAT
143static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], lock_stats); 143static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS],
144 cpu_lock_stats);
144 145
145static int lock_point(unsigned long points[], unsigned long ip) 146static int lock_point(unsigned long points[], unsigned long ip)
146{ 147{
@@ -186,7 +187,7 @@ struct lock_class_stats lock_stats(struct lock_class *class)
186 memset(&stats, 0, sizeof(struct lock_class_stats)); 187 memset(&stats, 0, sizeof(struct lock_class_stats));
187 for_each_possible_cpu(cpu) { 188 for_each_possible_cpu(cpu) {
188 struct lock_class_stats *pcs = 189 struct lock_class_stats *pcs =
189 &per_cpu(lock_stats, cpu)[class - lock_classes]; 190 &per_cpu(cpu_lock_stats, cpu)[class - lock_classes];
190 191
191 for (i = 0; i < ARRAY_SIZE(stats.contention_point); i++) 192 for (i = 0; i < ARRAY_SIZE(stats.contention_point); i++)
192 stats.contention_point[i] += pcs->contention_point[i]; 193 stats.contention_point[i] += pcs->contention_point[i];
@@ -213,7 +214,7 @@ void clear_lock_stats(struct lock_class *class)
213 214
214 for_each_possible_cpu(cpu) { 215 for_each_possible_cpu(cpu) {
215 struct lock_class_stats *cpu_stats = 216 struct lock_class_stats *cpu_stats =
216 &per_cpu(lock_stats, cpu)[class - lock_classes]; 217 &per_cpu(cpu_lock_stats, cpu)[class - lock_classes];
217 218
218 memset(cpu_stats, 0, sizeof(struct lock_class_stats)); 219 memset(cpu_stats, 0, sizeof(struct lock_class_stats));
219 } 220 }
@@ -223,12 +224,12 @@ void clear_lock_stats(struct lock_class *class)
223 224
224static struct lock_class_stats *get_lock_stats(struct lock_class *class) 225static struct lock_class_stats *get_lock_stats(struct lock_class *class)
225{ 226{
226 return &get_cpu_var(lock_stats)[class - lock_classes]; 227 return &get_cpu_var(cpu_lock_stats)[class - lock_classes];
227} 228}
228 229
229static void put_lock_stats(struct lock_class_stats *stats) 230static void put_lock_stats(struct lock_class_stats *stats)
230{ 231{
231 put_cpu_var(lock_stats); 232 put_cpu_var(cpu_lock_stats);
232} 233}
233 234
234static void lock_release_holdtime(struct held_lock *hlock) 235static void lock_release_holdtime(struct held_lock *hlock)