From: Viresh Kumar Date: Thu, 12 Jun 2014 10:54:41 +0000 (+0530) Subject: nohz: Avoid tick's double reprogramming in highres mode X-Git-Tag: v4.14-rc1~6722^2~12^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a16fc93d2c9568e16d45db77c7b5f15e1921cf1;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Viresh Kumar Cc: Thomas Gleixner Signed-off-by: Frederic Weisbecker --- diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 153870a..cc0a5b6 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -1099,6 +1099,10 @@ static enum hrtimer_restart tick_sched_timer(struct hrtimer *timer) if (regs) tick_sched_handle(ts, regs); + /* 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;