summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLiang Hao <haohlliang@gmail.com>2026-09-30 14:36:21 +0800
committerThomas Gleixner <tglx@kernel.org>2026-10-20 15:28:14 +0200
commite7cad586d73276cbd4466de81b2092287d7475c0 (patch)
tree71b045e73844ee3266f0f3361853a03c9fbc9c42 /kernel
parentc03c1a14507dfaf8b856c2608f9ac216021fc222 (diff)
timers: Clear pending_map on CPU hotplug
CPU hotplug migration leaves pending_map bits set on the outgoing CPU while its wheel vectors are empty. After re-online, a later next_expiry recalc can treat those empty buckets as pending and temporarily pull next_expiry forward until collect drains the bits. Clear pending_map under the base lock after migration in timers_dead_cpu(). Fixes: 500462a9de65 ("timers: Switch to a non-cascading wheel") Signed-off-by: Liang Hao <haohlliang@gmail.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260930063621.37740-1-haohlliang@gmail.com
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/timer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index ae9abf14688e..fc374444acb6 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -44,6 +44,7 @@
#include <linux/compat.h>
#include <linux/random.h>
#include <linux/sysctl.h>
+#include <linux/bitmap.h>
#include <linux/uaccess.h>
#include <asm/unistd.h>
@@ -2541,6 +2542,7 @@ int timers_dead_cpu(unsigned int cpu)
for (i = 0; i < WHEEL_SIZE; i++)
migrate_timer_list(new_base, old_base->vectors + i);
+ bitmap_zero(old_base->pending_map, WHEEL_SIZE);
raw_spin_unlock(&old_base->lock);
raw_spin_unlock_irq(&new_base->lock);
put_cpu_ptr(&timer_bases);