linux-kernelorg-stable/kernel/time
Xiongfeng Wang e895f8e291 hrtimers: Unconditionally update target CPU base after offline timer migration
When testing softirq based hrtimers on an ARM32 board, with high resolution
mode and NOHZ inactive, softirq based hrtimers fail to expire after being
moved away from an offline CPU:

CPU0				CPU1
				hrtimer_start(..., HRTIMER_MODE_SOFT);
cpu_down(CPU1)			...
				hrtimers_cpu_dying()
				  // Migrate timers to CPU0
				  smp_call_function_single(CPU0, returgger_next_event);
  retrigger_next_event()
    if (!highres && !nohz)
        return;

As retrigger_next_event() is a NOOP when both high resolution timers and
NOHZ are inactive CPU0's hrtimer_cpu_base::softirq_expires_next is not
updated and the migrated softirq timers never expire unless there is a
softirq based hrtimer queued on CPU0 later.

Fix this by removing the hrtimer_hres_active() and tick_nohz_active() check
in retrigger_next_event(), which enforces a full update of the CPU base.
As this is not a fast path the extra cost does not matter.

[ tglx: Massaged change log ]

Fixes: 5c0930ccaa ("hrtimers: Push pending hrtimers away from outgoing CPU earlier")
Co-developed-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250805081025.54235-1-wangxiongfeng2@huawei.com
2025-09-09 14:05:16 +02:00
..
Kconfig
Makefile
alarmtimer.c
clockevents.c
clocksource-wdtest.c
clocksource.c bitmap-for-6.17 2025-07-31 16:52:32 -07:00
hrtimer.c hrtimers: Unconditionally update target CPU base after offline timer migration 2025-09-09 14:05:16 +02:00
itimer.c
jiffies.c
namespace.c vdso/vsyscall: Update auxiliary clock data in the datapage 2025-07-18 13:45:33 +02:00
ntp.c ntp: Use ktime_get_ntp_seconds() 2025-06-19 14:28:24 +02:00
ntp_internal.h
posix-clock.c
posix-cpu-timers.c
posix-stubs.c
posix-timers.c timekeeping: Add minimal posix-timers support for auxiliary clocks 2025-06-27 20:13:12 +02:00
posix-timers.h timekeeping: Add minimal posix-timers support for auxiliary clocks 2025-06-27 20:13:12 +02:00
sched_clock.c
sleep_timeout.c
test_udelay.c
tick-broadcast-hrtimer.c
tick-broadcast.c
tick-common.c
tick-internal.h
tick-legacy.c
tick-oneshot.c
tick-sched.c
tick-sched.h
time.c
time_test.c
timeconst.bc
timeconv.c
timecounter.c time/timecounter: Fix the lie that struct cyclecounter is const 2025-07-01 15:38:25 +02:00
timekeeping.c vdso/vsyscall: Avoid slow division loop in auxiliary clock update 2025-09-03 11:55:11 +02:00
timekeeping.h
timekeeping_debug.c
timekeeping_internal.h timekeeping: Provide ktime_get_ntp_seconds() 2025-06-19 14:28:23 +02:00
timer.c
timer_list.c
timer_migration.c
timer_migration.h
vsyscall.c vdso/vsyscall: Avoid slow division loop in auxiliary clock update 2025-09-03 11:55:11 +02:00