Ubuntu-focal-kernel/kernel/time
Thomas Gleixner 464085e771 hrtimers: Push pending hrtimers away from outgoing CPU earlier
BugLink: https://bugs.launchpad.net/bugs/2049935

[ Upstream commit 5c0930ccaad5a74d74e8b18b648c5eb21ed2fe94 ]

2b8272ff4a70 ("cpu/hotplug: Prevent self deadlock on CPU hot-unplug")
solved the straight forward CPU hotplug deadlock vs. the scheduler
bandwidth timer. Yu discovered a more involved variant where a task which
has a bandwidth timer started on the outgoing CPU holds a lock and then
gets throttled. If the lock required by one of the CPU hotplug callbacks
the hotplug operation deadlocks because the unthrottling timer event is not
handled on the dying CPU and can only be recovered once the control CPU
reaches the hotplug state which pulls the pending hrtimers from the dead
CPU.

Solve this by pushing the hrtimers away from the dying CPU in the dying
callbacks. Nothing can queue a hrtimer on the dying CPU at that point because
all other CPUs spin in stop_machine() with interrupts disabled and once the
operation is finished the CPU is marked offline.

Reported-by: Yu Liao <liaoyu15@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Liu Tie <liutie4@huawei.com>
Link: https://lore.kernel.org/r/87a5rphara.ffs@tglx
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2024-02-02 14:13:17 +01:00
..
Kconfig
Makefile
alarmtimer.c alarmtimer: Prevent starvation by small intervals and SIG_IGN 2023-04-18 17:21:05 +02:00
clockevents.c
clocksource.c clocksource: Retry clock read if long delays detected 2021-08-13 09:45:19 +02:00
hrtimer.c hrtimers: Push pending hrtimers away from outgoing CPU earlier 2024-02-02 14:13:17 +01:00
itimer.c
jiffies.c timekeeping: Split jiffies seqlock 2023-08-09 12:25:16 +02:00
ntp.c
ntp_internal.h
posix-clock.c
posix-cpu-timers.c kernel, fs: Introduce and use set_restart_fn() and arch_set_restart_data() 2021-04-23 11:51:03 +02:00
posix-stubs.c timers: Prevent union confusion from unexpected restart_syscall() 2023-05-12 17:15:06 +02:00
posix-timers.c posix-timers: Ensure timer ID search-loop limit is valid 2023-10-02 12:12:15 +02:00
posix-timers.h
sched_clock.c
test_udelay.c
tick-broadcast-hrtimer.c
tick-broadcast.c tick: Get rid of tick_period 2023-08-09 12:25:16 +02:00
tick-common.c tick/common: Align tick period during sched_timer setup 2023-10-02 12:11:56 +02:00
tick-internal.h tick: Get rid of tick_period 2023-08-09 12:25:16 +02:00
tick-oneshot.c
tick-sched.c tick/common: Align tick period during sched_timer setup 2023-10-02 12:11:56 +02:00
tick-sched.h
time.c
timeconst.bc
timeconv.c
timecounter.c
timekeeping.c timekeeping: Split jiffies seqlock 2023-08-09 12:25:16 +02:00
timekeeping.h timekeeping: Split jiffies seqlock 2023-08-09 12:25:16 +02:00
timekeeping_debug.c
timekeeping_internal.h
timer.c random32: add noise from network and scheduling activity 2023-10-02 12:11:55 +02:00
timer_list.c
vsyscall.c