tick: Move tick cancellation up to CPUHP_AP_TICK_DYING
authorFrederic Weisbecker <frederic@kernel.org>
Sun, 25 Feb 2024 22:55:00 +0000 (23:55 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 26 Feb 2024 10:37:31 +0000 (11:37 +0100)
The tick hrtimer is cancelled right before hrtimers are migrated. This
is done from the hrtimer subsystem even though it shouldn't know about
its actual users.

Move instead the tick hrtimer cancellation to the relevant CPU hotplug
state that aims at centralizing high level tick shutdown operations so
that the related flow is easy to follow.

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-9-frederic@kernel.org
kernel/time/hrtimer.c
kernel/time/tick-common.c

index 95f1f351dcd9717bb6240d61006182c488183bb4..3e95474199ac16ee545015bd5fb55e66fd821294 100644 (file)
@@ -2229,8 +2229,6 @@ int hrtimers_cpu_dying(unsigned int dying_cpu)
        int i, ncpu = cpumask_any_and(cpu_active_mask, housekeeping_cpumask(HK_TYPE_TIMER));
        struct hrtimer_cpu_base *old_base, *new_base;
 
-       tick_cancel_sched_timer(dying_cpu);
-
        old_base = this_cpu_ptr(&hrtimer_bases);
        new_base = &per_cpu(hrtimer_bases, ncpu);
 
index a89ef450fda7b5e01f37c56ee7daed3689ea6b7d..b4af8c743b737fe2628eaf61855c154c467a0c95 100644 (file)
@@ -410,6 +410,8 @@ int tick_cpu_dying(unsigned int dying_cpu)
        if (tick_do_timer_cpu == dying_cpu)
                tick_do_timer_cpu = cpumask_first(cpu_online_mask);
 
+       tick_cancel_sched_timer(dying_cpu);
+
        return 0;
 }