sched: sched_clock_cpu() based cpu_clock(), lockdep fix
authorIngo Molnar <mingo@elte.hu>
Sun, 29 Jun 2008 13:01:59 +0000 (15:01 +0200)
committerIngo Molnar <mingo@elte.hu>
Sun, 29 Jun 2008 13:05:00 +0000 (15:05 +0200)
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>
kernel/sched_clock.c

index ed5a8c415046fbd05f0be8d8ff71ffe67ee4674e..60094e257a9a1616e187b2b2449ec998b01c9b86 100644 (file)
@@ -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;
 }