[PATCH 2/4] tick/sched: Set last_tick in init paths
From: Scott Wood
Date: Mon Dec 16 2019 - 18:22:36 EST
This eliminates the need to save last_tick on nohz entry.
Signed-off-by: Scott Wood <swood@xxxxxxxxxx>
---
kernel/time/tick-sched.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 8936b604dd6c..59e663e240fc 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -794,7 +794,6 @@ static void tick_nohz_stop_tick(struct tick_sched *ts, int cpu)
calc_load_nohz_start();
quiet_vmstat();
- ts->last_tick = hrtimer_get_expires(&ts->sched_timer);
ts->tick_stopped = 1;
trace_tick_stop(1, TICK_DEP_MASK_NONE);
}
@@ -1248,6 +1247,7 @@ static void tick_nohz_switch_to_nohz(void)
hrtimer_set_expires(&ts->sched_timer, next);
hrtimer_forward_now(&ts->sched_timer, tick_period);
+ ts->last_tick = hrtimer_get_expires(&ts->sched_timer);
tick_program_event(hrtimer_get_expires(&ts->sched_timer), 1);
tick_nohz_activate(ts, NOHZ_MODE_LOWRES);
}
@@ -1355,6 +1355,7 @@ void tick_setup_sched_timer(void)
}
hrtimer_forward(&ts->sched_timer, now, tick_period);
+ ts->last_tick = hrtimer_get_expires(&ts->sched_timer);
hrtimer_start_expires(&ts->sched_timer, HRTIMER_MODE_ABS_PINNED_HARD);
tick_nohz_activate(ts, NOHZ_MODE_HIGHRES);
}
--
1.8.3.1