]> Git Repo - linux.git/commitdiff
sched_clock: Disable seqlock lockdep usage in sched_clock()
authorJohn Stultz <[email protected]>
Thu, 2 Jan 2014 23:11:14 +0000 (15:11 -0800)
committerIngo Molnar <[email protected]>
Sun, 12 Jan 2014 09:14:00 +0000 (10:14 +0100)
Unfortunately the seqlock lockdep enablement can't be used
in sched_clock(), since the lockdep infrastructure eventually
calls into sched_clock(), which causes a deadlock.

Thus, this patch changes all generic sched_clock() usage
to use the raw_* methods.

Acked-by: Linus Torvalds <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
Reported-by: Krzysztof Hałasa <[email protected]>
Signed-off-by: John Stultz <[email protected]>
Cc: Uwe Kleine-König <[email protected]>
Cc: Willy Tarreau <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
kernel/time/sched_clock.c

index 68b79937598106918748832a396848f7fd22f870..0abb364642818e4ef842ab2f3631d15cb80400f2 100644 (file)
@@ -74,7 +74,7 @@ unsigned long long notrace sched_clock(void)
                return cd.epoch_ns;
 
        do {
-               seq = read_seqcount_begin(&cd.seq);
+               seq = raw_read_seqcount_begin(&cd.seq);
                epoch_cyc = cd.epoch_cyc;
                epoch_ns = cd.epoch_ns;
        } while (read_seqcount_retry(&cd.seq, seq));
@@ -99,10 +99,10 @@ static void notrace update_sched_clock(void)
                          cd.mult, cd.shift);
 
        raw_local_irq_save(flags);
-       write_seqcount_begin(&cd.seq);
+       raw_write_seqcount_begin(&cd.seq);
        cd.epoch_ns = ns;
        cd.epoch_cyc = cyc;
-       write_seqcount_end(&cd.seq);
+       raw_write_seqcount_end(&cd.seq);
        raw_local_irq_restore(flags);
 }
 
This page took 0.049883 seconds and 4 git commands to generate.