|
@@ -767,7 +767,7 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
|
|
|
tick = expires;
|
|
|
|
|
|
/* Skip reprogram of event if its not changed */
|
|
|
- if (ts->tick_stopped && (expires == dev->next_event))
|
|
|
+ if (ts->tick_stopped && (expires == ts->next_tick))
|
|
|
goto out;
|
|
|
|
|
|
/*
|
|
@@ -787,6 +787,8 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
|
|
|
trace_tick_stop(1, TICK_DEP_MASK_NONE);
|
|
|
}
|
|
|
|
|
|
+ ts->next_tick = tick;
|
|
|
+
|
|
|
/*
|
|
|
* If the expiration time == KTIME_MAX, then we simply stop
|
|
|
* the tick timer.
|
|
@@ -802,7 +804,10 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
|
|
|
else
|
|
|
tick_program_event(tick, 1);
|
|
|
out:
|
|
|
- /* Update the estimated sleep length */
|
|
|
+ /*
|
|
|
+ * Update the estimated sleep length until the next timer
|
|
|
+ * (not only the tick).
|
|
|
+ */
|
|
|
ts->sleep_length = ktime_sub(dev->next_event, now);
|
|
|
return tick;
|
|
|
}
|