diff options
author | Frederic Weisbecker <[email protected]> | 2013-12-17 00:16:37 +0100 |
---|---|---|
committer | Frederic Weisbecker <[email protected]> | 2014-01-15 23:07:11 +0100 |
commit | 855a0fc30b70d6ae681badd24d6625f9a9abb787 (patch) | |
tree | 4cd7ec203e28db952889a36e6a181414d4e26c02 | |
parent | 5acac1be499d979e3aa463ea73a498888faefcbe (diff) |
nohz: Get timekeeping max deferment outside jiffies_lock
We don't need to fetch the timekeeping max deferment under the
jiffies_lock seqlock.
If the clocksource is updated concurrently while we stop the tick,
stop machine is called and the tick will be reevaluated again along with
uptodate jiffies and its related values.
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Alex Shi <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Paul E. McKenney <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Kevin Hilman <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Frederic Weisbecker <[email protected]>
-rw-r--r-- | kernel/time/tick-sched.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index e4d0f093061f..68331d16b4ed 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -533,12 +533,13 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev; u64 time_delta; + time_delta = timekeeping_max_deferment(); + /* Read jiffies and the time when jiffies were updated last */ do { seq = read_seqbegin(&jiffies_lock); last_update = last_jiffies_update; last_jiffies = jiffies; - time_delta = timekeeping_max_deferment(); } while (read_seqretry(&jiffies_lock, seq)); if (rcu_needs_cpu(cpu, &rcu_delta_jiffies) || |