Commit 8378c891 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'timers-urgent-2025-09-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer fix from Ingo Molnar:
 "Fix a lost-timeout CPU hotplug bug in the hrtimer code, which can
  trigger with certain hardware configs and regular HZ"

* tag 'timers-urgent-2025-09-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  hrtimers: Unconditionally update target CPU base after offline timer migration
parents 563b3f6e e895f8e2
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -787,10 +787,10 @@ static void retrigger_next_event(void *arg)
	 * of the next expiring timer is enough. The return from the SMP
	 * function call will take care of the reprogramming in case the
	 * CPU was in a NOHZ idle sleep.
	 *
	 * In periodic low resolution mode, the next softirq expiration
	 * must also be updated.
	 */
	if (!hrtimer_hres_active(base) && !tick_nohz_active)
		return;

	raw_spin_lock(&base->lock);
	hrtimer_update_base(base);
	if (hrtimer_hres_active(base))
@@ -2295,11 +2295,6 @@ int hrtimers_cpu_dying(unsigned int dying_cpu)
				     &new_base->clock_base[i]);
	}

	/*
	 * The migration might have changed the first expiring softirq
	 * timer on this CPU. Update it.
	 */
	__hrtimer_get_next_event(new_base, HRTIMER_ACTIVE_SOFT);
	/* Tell the other CPU to retrigger the next event */
	smp_call_function_single(ncpu, retrigger_next_event, NULL, 0);