linux-yocto/kernel/time
Xiongfeng Wang 156677ea10 hrtimers: Unconditionally update target CPU base after offline timer migration
[ Upstream commit e895f8e29119c8c966ea794af9e9100b10becb88 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-09-19 16:32:07 +02:00
..
alarmtimer.c alarmtimer: Remove unnecessary (void *) cast 2023-06-18 22:41:53 +02:00
clockevents.c clockevents: Repair kernel-doc for clockevent_delta2ns() 2022-12-01 13:35:41 +01:00
clocksource-wdtest.c clocksource: Scale the watchdog read retries automatically 2024-08-14 13:58:56 +02:00
clocksource.c clocksource: Fix the CPUs' choice in the watchdog per CPU verification 2025-06-27 11:08:51 +01:00
hrtimer.c hrtimers: Unconditionally update target CPU base after offline timer migration 2025-09-19 16:32:07 +02:00
itimer.c
jiffies.c
Kconfig clocksource: Loosen clocksource watchdog constraints 2023-01-03 20:43:45 -08:00
Makefile
namespace.c vdso/timens: Refactor copy-pasted find_timens_vvar_page() helper into one copy 2022-12-01 11:35:40 +01:00
ntp_internal.h ntp: Make the RTC synchronization more reliable 2020-12-11 10:40:52 +01:00
ntp.c ntp: Remove invalid cast in time offset math 2024-12-14 19:59:44 +01:00
posix-clock.c posix-clock: posix-clock: Fix unbalanced locking in pc_clock_settime() 2024-11-01 01:58:30 +01:00
posix-cpu-timers.c posix-cpu-timers: fix race between handle_posix_cpu_timers() and posix_cpu_timer_del() 2025-06-19 15:28:45 +02:00
posix-stubs.c posix-timers: Get rid of [COMPAT_]SYS_NI() uses 2024-01-20 11:51:46 +01:00
posix-timers.c posix-timers: Add cond_resched() to posix_timer_add() search loop 2025-06-04 14:41:59 +02:00
posix-timers.h
sched_clock.c time/sched_clock: Provide sched_clock_noinstr() 2023-06-05 21:11:04 +02:00
test_udelay.c time/debug: Fix memory leak with using debugfs_lookup() 2023-02-09 20:12:27 +01:00
tick-broadcast-hrtimer.c time/tick-broadcast: Remove RCU_NONIDLE() usage 2023-01-13 11:48:16 +01:00
tick-broadcast.c tick/broadcast: Move per CPU pointer access into the atomic section 2024-08-14 13:58:55 +02:00
tick-common.c timekeeping: Add a lockdep override in tick_freeze() 2025-05-02 07:51:00 +02:00
tick-internal.h
tick-legacy.c
tick-oneshot.c time: Fix various kernel-doc problems 2023-01-03 11:07:58 +01:00
tick-sched.c tick/sched: Preserve number of idle sleeps across CPU hotplug events 2024-01-31 16:19:13 -08:00
tick-sched.h tick: Move got_idle_tick away from common flags 2024-08-29 17:33:35 +02:00
time_test.c time: test: Fix incorrect format specifier 2024-03-26 18:19:18 -04:00
time.c time: Fix references to _msecs_to_jiffies() handling of values 2024-12-09 10:31:50 +01:00
timeconst.bc
timeconv.c
timecounter.c
timekeeping_debug.c
timekeeping_internal.h
timekeeping.c timekeeping: Fix bogus clock_was_set() invocation in do_adjtimex() 2024-08-14 13:58:57 +02:00
timekeeping.h
timer_list.c timer_list: Don't use %pK through printk() 2025-06-04 14:41:59 +02:00
timer.c timers: Provide timer_shutdown[_sync]() 2022-11-24 15:09:12 +01:00
vsyscall.c