tick: Assume the tick can't be stopped in NOHZ_MODE_INACTIVE mode
authorFrederic Weisbecker <frederic@kernel.org>
Sun, 25 Feb 2024 22:55:02 +0000 (23:55 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 26 Feb 2024 10:37:32 +0000 (11:37 +0100)
The full-nohz update function checks if the nohz mode is active before
proceeding. It considers one exception though: if the tick is already
stopped even though the nohz mode is inactive, it still moves on in
order to update/restart the tick if needed.

However in order for the tick to be stopped, the nohz_mode has to be
either NOHZ_MODE_LOWRES or NOHZ_MODE_HIGHRES. Therefore it doesn't make
sense to test if the tick is stopped before verifying NOHZ_MODE_INACTIVE
mode.

Remove the needless related condition.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240225225508.11587-11-frederic@kernel.org
kernel/time/tick-sched.c

index b17895de26b9f21dfc186646e8de3a722af1e6b5..b79f5403433bd5de7021dfb3e4dbb342ff8c6f66 100644 (file)
@@ -1086,7 +1086,7 @@ static void tick_nohz_full_update_tick(struct tick_sched *ts)
        if (!tick_nohz_full_cpu(smp_processor_id()))
                return;
 
-       if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE)
+       if (ts->nohz_mode == NOHZ_MODE_INACTIVE)
                return;
 
        __tick_nohz_full_update_tick(ts, ktime_get());