aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/tick-sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time/tick-sched.c')
-rw-r--r--kernel/time/tick-sched.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 7c7ec4515983..7ea28ed3109d 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -603,15 +603,31 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
603 603
604 /* 604 /*
605 * If the tick is due in the next period, keep it ticking or 605 * If the tick is due in the next period, keep it ticking or
606 * restart it proper. 606 * force prod the timer.
607 */ 607 */
608 delta = next_tick - basemono; 608 delta = next_tick - basemono;
609 if (delta <= (u64)TICK_NSEC) { 609 if (delta <= (u64)TICK_NSEC) {
610 tick.tv64 = 0; 610 tick.tv64 = 0;
611 /*
612 * We've not stopped the tick yet, and there's a timer in the
613 * next period, so no point in stopping it either, bail.
614 */
611 if (!ts->tick_stopped) 615 if (!ts->tick_stopped)
612 goto out; 616 goto out;
617
618 /*
619 * If, OTOH, we did stop it, but there's a pending (expired)
620 * timer reprogram the timer hardware to fire now.
621 *
622 * We will not restart the tick proper, just prod the timer
623 * hardware into firing an interrupt to process the pending
624 * timers. Just like tick_irq_exit() will not restart the tick
625 * for 'normal' interrupts.
626 *
627 * Only once we exit the idle loop will we re-enable the tick,
628 * see tick_nohz_idle_exit().
629 */
613 if (delta == 0) { 630 if (delta == 0) {
614 /* Tick is stopped, but required now. Enforce it */
615 tick_nohz_restart(ts, now); 631 tick_nohz_restart(ts, now);
616 goto out; 632 goto out;
617 } 633 }