milos-linux/kernel/time
Amit Matityahu d486b4934a timers/migration: Fix livelock in tmigr_handle_remote_up()
tmigr_handle_remote_cpu() skips timer_expire_remote() when cpu ==
smp_processor_id(), assuming the local softirq path already handled this
CPU's timers.

This assumption is wrong because jiffies can advance after the handling of
the CPU's global timers in run_timer_base(BASE_GLOBAL) and before
tmigr_handle_remote() evaluates the expiry times.

As a consequence a timer which expires after the CPU local timer wheel
advanced and becomes expired in the remote handling is ignored and the
callback is never invoked and removed from the timer wheel.

What's worse is that fetch_next_timer_interrupt_remote() keeps reporting it
as expired, and the event is re-queued with expires == now on each
iteration.  The goto-again loop spins indefinitely.

Fix this by calling timer_expire_remote() unconditionally. That's minimal
overhead for the common case as __run_timer_base() returns immediately if
there is nothing to expire in the local wheel.

[ tglx: Amend change log and add a comment ]

Fixes: 7ee9887703 ("timers: Implement the hierarchical pull model")
Reported-by: Alon Kariv <alonka@amazon.com>
Signed-off-by: Amit Matityahu <amitmat@amazon.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260603170139.33628-1-amitmat@amazon.com
2026-06-04 14:35:33 +02:00
..
.kunitconfig time/kunit: Add .kunitconfig 2026-02-24 08:41:51 +01:00
alarmtimer.c Merge branch 'timers/urgent' into timers/core 2026-04-11 07:58:33 +02:00
clockevents.c clockevents: Fix duplicate type specifier in stub function parameter 2026-06-02 21:07:55 +02:00
clocksource-wdtest.c clocksource: Rewrite watchdog code completely 2026-03-20 13:36:32 +01:00
clocksource.c clocksource: Rewrite watchdog code completely 2026-03-20 13:36:32 +01:00
hrtimer.c Merge branch 'timers/urgent' into timers/core 2026-04-11 07:58:33 +02:00
itimer.c
jiffies.c Linux 7.0-rc4 2026-03-21 08:02:36 +01:00
Kconfig Update to the VDSO subsystem: 2026-04-14 10:53:44 -07:00
Makefile timens: Remove dependency on the vDSO 2026-03-26 15:44:23 +01:00
namespace.c timens: Use task_lock guard in timens_get*() 2026-04-01 17:13:36 +02:00
namespace_internal.h timens: Remove dependency on the vDSO 2026-03-26 15:44:23 +01:00
namespace_vdso.c mm.git review status for linus..mm-stable 2026-04-15 12:59:16 -07:00
ntp.c
ntp_internal.h
posix-clock.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
posix-cpu-timers.c
posix-stubs.c
posix-timers.c posix-timers: Fix stale function name in comment 2026-03-28 14:18:13 +01:00
posix-timers.h
sched_clock.c time/sched_clock: Use ACCESS_PRIVATE() to evaluate hrtimer::function 2026-01-13 18:08:57 +01:00
sleep_timeout.c
test_udelay.c
tick-broadcast-hrtimer.c clockevents: Remove redundant CLOCK_EVT_FEAT_KTIME 2026-02-27 16:40:06 +01:00
tick-broadcast.c clockevents: Add missing resets of the next_event_forced flag 2026-04-16 21:22:04 +02:00
tick-common.c clockevents: Prevent timer interrupt starvation 2026-04-10 22:45:38 +02:00
tick-internal.h cpufreq: ondemand: Simplify idle cputime granularity test 2026-01-28 22:24:58 +01:00
tick-legacy.c
tick-oneshot.c treewide: Update email address 2026-01-11 06:09:11 -10:00
tick-sched.c Merge branch 'timers/urgent' into timers/core 2026-04-11 07:58:33 +02:00
tick-sched.h
time.c time: Fix off-by-one in settimeofday() usec validation 2026-06-02 21:07:55 +02:00
time_test.c time/kunit: Document handling of negative years of is_leap() 2026-02-02 12:37:54 +01:00
timeconst.bc
timeconv.c
timecounter.c time/timecounter: Inline timecounter_cyc2time() 2025-12-15 20:16:49 +01:00
timekeeping.c Linux 7.0-rc4 2026-03-21 08:02:36 +01:00
timekeeping.h timekeeping: Provide infrastructure for coupled clockevents 2026-02-27 16:40:08 +01:00
timekeeping_debug.c
timekeeping_internal.h
timer.c timers: Get this_cpu once while clearing the idle state 2026-03-24 23:21:30 +01:00
timer_list.c timer_list: Print offset as signed integer 2026-03-12 12:15:54 +01:00
timer_migration.c timers/migration: Fix livelock in tmigr_handle_remote_up() 2026-06-04 14:35:33 +02:00
timer_migration.h timers/migration: Rename 'online' bit to 'available' 2025-11-20 20:17:31 +01:00
vsyscall.c