Commit 01f38497 authored by Joel Fernandes (Google)'s avatar Joel Fernandes (Google) Committed by Steven Rostedt (VMware)

lockdep: Use this_cpu_ptr instead of get_cpu_var stats

get_cpu_var disables preemption which has the potential to call into the
preemption disable trace points causing some complications. There's also
no need to disable preemption in uses of get_lock_stats anyway since
preempt is already disabled. So lets simplify the code.

Link: default avatarPeter Zijlstra <>
Acked-by: default avatarPeter Zijlstra <>
Signed-off-by: default avatarJoel Fernandes (Google) <>
Signed-off-by: default avatarSteven Rostedt (VMware) <>
parent 6fc7c411
......@@ -248,12 +248,7 @@ void clear_lock_stats(struct lock_class *class)
static struct lock_class_stats *get_lock_stats(struct lock_class *class)
return &get_cpu_var(cpu_lock_stats)[class - lock_classes];
static void put_lock_stats(struct lock_class_stats *stats)
return &this_cpu_ptr(cpu_lock_stats)[class - lock_classes];
static void lock_release_holdtime(struct held_lock *hlock)
......@@ -271,7 +266,6 @@ static void lock_release_holdtime(struct held_lock *hlock)
lock_time_inc(&stats->read_holdtime, holdtime);
lock_time_inc(&stats->write_holdtime, holdtime);
static inline void lock_release_holdtime(struct held_lock *hlock)
......@@ -4090,7 +4084,6 @@ __lock_contended(struct lockdep_map *lock, unsigned long ip)
if (lock->cpu != smp_processor_id())
stats->bounces[bounce_contended + !!hlock->read]++;
static void
......@@ -4138,7 +4131,6 @@ __lock_acquired(struct lockdep_map *lock, unsigned long ip)
if (lock->cpu != cpu)
stats->bounces[bounce_acquired + !!hlock->read]++;
lock->cpu = cpu;
lock->ip = ip;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment