Skip to content

Commit

Permalink
sched: sched_clock_cpu() based cpu_clock(), lockdep fix
Browse files Browse the repository at this point in the history
Vegard Nossum reported:

> WARNING: at kernel/lockdep.c:2738 check_flags+0x142/0x160()

which happens due to:

 unsigned long long cpu_clock(int cpu)
 {
         unsigned long long clock;
         unsigned long flags;

         raw_local_irq_save(flags);

as lower level functions can take locks, we must not do that, use
proper lockdep-annotated irq save/restore.

Reported-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed Jun 29, 2008
1 parent 4c9fe8a commit 2d452c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/sched_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ unsigned long long cpu_clock(int cpu)
unsigned long long clock;
unsigned long flags;

raw_local_irq_save(flags);
local_irq_save(flags);
clock = sched_clock_cpu(cpu);
raw_local_irq_restore(flags);
local_irq_restore(flags);

return clock;
}
Expand Down

0 comments on commit 2d452c9

Please sign in to comment.