aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2014-06-12 16:24:41 +0530
committerMister Oyster <oysterized@gmail.com>2017-05-24 02:42:00 +0200
commit8101c96c7b7cb9606b36789239ab1ef61473a5b5 (patch)
treeed29e56bfee85e9168b354ac53a6759e20417685 /kernel
parenta44c9fb1fff29477c81d45bcb9d4431aa526b220 (diff)
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. Change-Id: I4e73da9bffbcac49789e5f279b67873f414b22a8 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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/tick-sched.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index ac7c177b1..6368929f9 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -1191,6 +1191,10 @@ static enum hrtimer_restart tick_sched_timer(struct hrtimer *timer)
}
#endif /* CONFIG_MTK_SCHED_RQAVG_US */
+ /* No need to reprogram if we are in idle or full dynticks mode */
+ if (unlikely(ts->tick_stopped))
+ return HRTIMER_NORESTART;
+
hrtimer_forward(timer, now, tick_period);
return HRTIMER_RESTART;