diff options
author | Ingo Molnar <mingo@kernel.org> | 2014-08-26 15:32:41 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-08-26 15:32:41 -0400 |
commit | 42594970022d223bf8f30d3aa22819e24779d6f6 (patch) | |
tree | 6b55f82a1fb1bb5dbb5ff61f90c41f7caa6a1f9b | |
parent | 52addcf9d6669fa439387610bc65c92fa0980cef (diff) | |
parent | 2a16fc93d2c9568e16d45db77c7b5f15e1921cf1 (diff) |
Merge branch 'nohz/drop-double-write-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into timers/core
Pull nohz fixes from Frederic Weisbecker:
" The tick reschedules itself unconditionally. It's relevant in periodic
mode but not in dynticks mode where it results in spurious double clock
writes and even spurious periodic behaviour for low-res case.
This set fixes that:
* 1st patch removes low-res periodic tick rescheduling in nohz mode.
This fixes spurious periodic behaviour.
* 2nd patch does the same for high-res mode. Here there is no such
spurious periodic behaviour but it still spares a double clock write
in some cases. "
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | kernel/time/tick-sched.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 99aa6ee3908f..cc0a5b6f741b 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -968,6 +968,10 @@ static void tick_nohz_handler(struct clock_event_device *dev) | |||
968 | tick_sched_do_timer(now); | 968 | tick_sched_do_timer(now); |
969 | tick_sched_handle(ts, regs); | 969 | tick_sched_handle(ts, regs); |
970 | 970 | ||
971 | /* No need to reprogram if we are running tickless */ | ||
972 | if (unlikely(ts->tick_stopped)) | ||
973 | return; | ||
974 | |||
971 | while (tick_nohz_reprogram(ts, now)) { | 975 | while (tick_nohz_reprogram(ts, now)) { |
972 | now = ktime_get(); | 976 | now = ktime_get(); |
973 | tick_do_update_jiffies64(now); | 977 | tick_do_update_jiffies64(now); |
@@ -1095,6 +1099,10 @@ static enum hrtimer_restart tick_sched_timer(struct hrtimer *timer) | |||
1095 | if (regs) | 1099 | if (regs) |
1096 | tick_sched_handle(ts, regs); | 1100 | tick_sched_handle(ts, regs); |
1097 | 1101 | ||
1102 | /* No need to reprogram if we are in idle or full dynticks mode */ | ||
1103 | if (unlikely(ts->tick_stopped)) | ||
1104 | return HRTIMER_NORESTART; | ||
1105 | |||
1098 | hrtimer_forward(timer, now, tick_period); | 1106 | hrtimer_forward(timer, now, tick_period); |
1099 | 1107 | ||
1100 | return HRTIMER_RESTART; | 1108 | return HRTIMER_RESTART; |