linux-kernelorg-stable/kernel
Xiongfeng Wang 51d7f652b3 hrtimers: Unconditionally update target CPU base after offline timer migration
commit e895f8e291 upstream.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-19 16:35:47 +02:00
..
bpf bpf: Tell memcg to use allow_spinning=false path in bpf_timer_init() 2025-09-19 16:35:44 +02:00
cgroup cgroup/cpuset: Fix a partition error with CPU hotplug 2025-08-28 16:31:11 +02:00
configs
debug
dma dma-debug: fix physical address calculation for struct dma_debug_entry 2025-09-19 16:35:42 +02:00
entry
events perf/core: Prevent VMA split of buffer mappings 2025-08-15 12:14:09 +02:00
futex futex: Pass in task to futex_queue() 2025-03-22 12:54:14 -07:00
gcov
irq genirq/irq_sim: Initialize work context pointers properly 2025-07-10 16:05:07 +02:00
kcsan kcsan: test: Initialize dummy variable 2025-08-15 12:13:46 +02:00
livepatch
locking locking/lockdep: Decrease nr_unused_locks if lock unused in zap_class() 2025-04-20 10:15:45 +02:00
module module: Prevent silent truncation of module name in delete_module(2) 2025-08-20 18:30:46 +02:00
power PM: sleep: console: Fix the black screen issue 2025-08-20 18:30:25 +02:00
printk printk: nbcon: Allow reacquire during panic 2025-08-20 18:30:47 +02:00
rcu rcu: Fix racy re-initialization of irq_work causing hangs 2025-08-20 18:30:58 +02:00
sched sched: Fix sched_numa_find_nth_cpu() if mask offline 2025-09-09 18:58:16 +02:00
time hrtimers: Unconditionally update target CPU base after offline timer migration 2025-09-19 16:35:47 +02:00
trace tracing: Silence warning when chunk allocation fails in trace_pid_write 2025-09-19 16:35:44 +02:00
.gitignore
Kconfig.freezer
Kconfig.hz
Kconfig.kexec crash, powerpc: default to CRASH_DUMP=n on PPC_BOOK3S_32 2024-11-14 22:43:48 -08:00
Kconfig.locks
Kconfig.preempt
Makefile
acct.c acct: block access to kernel internal filesystems 2025-02-27 04:30:23 -08:00
async.c
audit.c
audit.h audit,module: restore audit logging in load failure case 2025-08-15 12:13:31 +02:00
audit_fsnotify.c
audit_tree.c
audit_watch.c
auditfilter.c
auditsc.c audit,module: restore audit logging in load failure case 2025-08-15 12:13:31 +02:00
backtracetest.c
bounds.c
capability.c
cfi.c
compat.c
configs.c
context_tracking.c
cpu.c watchdog/hardlockup/perf: Fix perf_event memory leak 2025-04-10 14:39:11 +02:00
cpu_pm.c
crash_core.c
crash_reserve.c
cred.c
delayacct.c
dma.c
elfcorehdr.c
exec_domain.c
exit.c perf: Fix sample vs do_exit() 2025-06-27 11:11:45 +01:00
exit.h
extable.c
fail_function.c
fork.c kernel/fork: only call untrack_pfn_clear() on VMAs duplicated for fork() 2025-05-29 11:03:14 +02:00
freezer.c sched,freezer: Remove unnecessary warning in __thaw_task 2025-07-24 08:56:37 +02:00
gen_kheaders.sh kheaders: Ignore silly-rename files 2025-01-23 17:22:55 +01:00
groups.c
hung_task.c
iomem.c
irq_work.c
jump_label.c
kallsyms.c
kallsyms_internal.h
kallsyms_selftest.c
kallsyms_selftest.h
kcmp.c
kcov.c kcov: mark in_softirq_really() as __always_inline 2025-01-09 13:33:49 +01:00
kexec.c
kexec_core.c
kexec_elf.c kexec: initialize ELF lowest address to ULONG_MAX 2025-04-10 14:39:24 +02:00
kexec_file.c
kexec_internal.h
kheaders.c
kprobes.c
ksyms_common.c
ksysfs.c
kthread.c
latencytop.c
module_signature.c
notifier.c
nsproxy.c
padata.c padata: do not leak refcount in reorder_work 2025-05-29 11:03:19 +02:00
panic.c objtool, panic: Disable SMAP in __stack_chk_fail() 2025-05-02 07:59:19 +02:00
params.c module: ensure that kobject_put() is safe for module type kobjects 2025-05-18 08:24:54 +02:00
pid.c
pid_namespace.c
pid_sysctl.h
profile.c
ptrace.c
range.c
reboot.c Flush console log from kernel_power_off() 2025-04-20 10:15:12 +02:00
regset.c
relay.c
resource.c resource: fix false warning in __request_region() 2025-08-01 09:48:44 +01:00
resource_kunit.c
rseq.c rseq: Fix segfault on registration when rseq_cs is non-zero 2025-07-17 18:37:24 +02:00
scftorture.c
scs.c
seccomp.c seccomp: passthrough uretprobe systemcall without filtering 2025-02-17 10:05:12 +01:00
signal.c pidfs: improve multi-threaded exec and premature thread-group leader exit polling 2025-05-29 11:02:09 +02:00
smp.c
smpboot.c
smpboot.h
softirq.c lockdep: Fix wait context check on softirq for PREEMPT_RT 2025-05-29 11:02:08 +02:00
stackleak.c
stacktrace.c
static_call.c
static_call_inline.c x86/static-call: provide a way to do very early static-call updates 2024-12-19 18:13:23 +01:00
stop_machine.c sched/core: Fix migrate_swap() vs. hotplug 2025-07-17 18:37:03 +02:00
sys.c
sys_ni.c
sysctl-test.c
sysctl.c
task_work.c
taskstats.c
torture.c
tracepoint.c
tsacct.c
ucount.c ucount: fix atomic_long_inc_below() argument type 2025-08-15 12:13:59 +02:00
uid16.c
uid16.h
umh.c
up.c
user-return-notifier.c
user.c
user_namespace.c
usermode_driver.c
utsname.c
utsname_sysctl.c
vhost_task.c vhost_task: fix vhost_task_create() documentation 2025-05-29 11:01:59 +02:00
vmcore_info.c
watch_queue.c watch_queue: fix pipe accounting mismatch 2025-04-10 14:39:10 +02:00
watchdog.c watchdog: fix watchdog may detect false positive of softlockup 2025-06-27 11:11:22 +01:00
watchdog_buddy.c
watchdog_perf.c watchdog/hardlockup/perf: Fix perf_event memory leak 2025-04-10 14:39:11 +02:00
workqueue.c workqueue: Initialize wq_isolated_cpumask in workqueue_init_early() 2025-06-27 11:11:42 +01:00
workqueue_internal.h