diff options
author | John Stultz <john.stultz@linaro.org> | 2014-01-02 18:11:14 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-01-12 04:14:00 -0500 |
commit | 7a06c41cbec33c6dbe7eec575c61986122617408 (patch) | |
tree | 7b97849c95bbc76378e9136b2f8016be9e413e0d /kernel | |
parent | 0c3351d451ae2fa438d5d1ed719fc43354fbffbb (diff) |
sched_clock: Disable seqlock lockdep usage in sched_clock()
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 <torvalds@linux-foundation.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Reported-by: Krzysztof Hałasa <khalasa@piap.pl>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Willy Tarreau <w@1wt.eu>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1388704274-5278-2-git-send-email-john.stultz@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/time/sched_clock.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c index 68b799375981..0abb36464281 100644 --- a/kernel/time/sched_clock.c +++ b/kernel/time/sched_clock.c | |||
@@ -74,7 +74,7 @@ unsigned long long notrace sched_clock(void) | |||
74 | return cd.epoch_ns; | 74 | return cd.epoch_ns; |
75 | 75 | ||
76 | do { | 76 | do { |
77 | seq = read_seqcount_begin(&cd.seq); | 77 | seq = raw_read_seqcount_begin(&cd.seq); |
78 | epoch_cyc = cd.epoch_cyc; | 78 | epoch_cyc = cd.epoch_cyc; |
79 | epoch_ns = cd.epoch_ns; | 79 | epoch_ns = cd.epoch_ns; |
80 | } while (read_seqcount_retry(&cd.seq, seq)); | 80 | } while (read_seqcount_retry(&cd.seq, seq)); |
@@ -99,10 +99,10 @@ static void notrace update_sched_clock(void) | |||
99 | cd.mult, cd.shift); | 99 | cd.mult, cd.shift); |
100 | 100 | ||
101 | raw_local_irq_save(flags); | 101 | raw_local_irq_save(flags); |
102 | write_seqcount_begin(&cd.seq); | 102 | raw_write_seqcount_begin(&cd.seq); |
103 | cd.epoch_ns = ns; | 103 | cd.epoch_ns = ns; |
104 | cd.epoch_cyc = cyc; | 104 | cd.epoch_cyc = cyc; |
105 | write_seqcount_end(&cd.seq); | 105 | raw_write_seqcount_end(&cd.seq); |
106 | raw_local_irq_restore(flags); | 106 | raw_local_irq_restore(flags); |
107 | } | 107 | } |
108 | 108 | ||