Merge branches 'x86-ras-for-linus', 'x86-uv-for-linus' and 'x86-vdso-for-linus' of...
[firefly-linux-kernel-4.4.55.git] / kernel / time / tick-sched.c
index 5a9ff243588cc20a4019d4af496f9a9893d6cb8a..7c1412ea2d29836c54bff9ea841172e2f0827fec 100644 (file)
@@ -996,6 +996,10 @@ static void tick_nohz_handler(struct clock_event_device *dev)
        tick_sched_do_timer(now);
        tick_sched_handle(ts, regs);
 
+       /* No need to reprogram if we are running tickless  */
+       if (unlikely(ts->tick_stopped))
+               return;
+
        while (tick_nohz_reprogram(ts, now)) {
                now = ktime_get();
                tick_do_update_jiffies64(now);
@@ -1123,6 +1127,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;