Commit 2a16fc93d2c9568e16d45db77c7b5f15e1921cf1
Committed by
Frederic Weisbecker
1 parent
b5e995e671
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
nohz: Avoid tick's double reprogramming in highres mode
In highres mode, the tick reschedules itself unconditionally to the next jiffies. However while this clock reprogramming is relevant when the tick is in periodic mode, it's not that interesting when we run in dynticks mode because irq exit is likely going to overwrite the next tick to some randomly deferred future. So lets just get rid of this tick self rescheduling in dynticks mode. This way we can avoid some clockevents double write in favourable scenarios like when we stop the tick completely in idle while no other hrtimer is pending. Suggested-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff
kernel/time/tick-sched.c
... | ... | @@ -1099,6 +1099,10 @@ |
1099 | 1099 | if (regs) |
1100 | 1100 | tick_sched_handle(ts, regs); |
1101 | 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 | + | |
1102 | 1106 | hrtimer_forward(timer, now, tick_period); |
1103 | 1107 | |
1104 | 1108 | return HRTIMER_RESTART; |