Skip to content

Commit

Permalink
sched: sched_clock() lockdep fix
Browse files Browse the repository at this point in the history
Sitsofe Wheeler bisected the following commit to cause a lockdep to
warn about itself and turn itself off:

> commit c6531cc
> Author: Ingo Molnar <mingo@elte.hu>
> Date:   Mon May 12 21:21:14 2008 +0200
>
>     sched: do not trace sched_clock

do not use raw irq flags in cpu_clock() as it causes lockdep to lose
track of the true state of the IRQ flag.

Reported-and-bisected-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Ingo Molnar committed Jun 10, 2008
1 parent 34078a5 commit 040ec23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ unsigned long long notrace cpu_clock(int cpu)
unsigned long long prev_cpu_time, time, delta_time;
unsigned long flags;

raw_local_irq_save(flags);
local_irq_save(flags);
prev_cpu_time = per_cpu(prev_cpu_time, cpu);
time = __cpu_clock(cpu) + per_cpu(time_offset, cpu);
delta_time = time-prev_cpu_time;
Expand All @@ -898,7 +898,7 @@ unsigned long long notrace cpu_clock(int cpu)
time = __sync_cpu_clock(time, cpu);
per_cpu(prev_cpu_time, cpu) = time;
}
raw_local_irq_restore(flags);
local_irq_restore(flags);

return time;
}
Expand Down

0 comments on commit 040ec23

Please sign in to comment.