mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Liang Hao" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Liang Hao <haohlliang@gmail.com>,
	Thomas Gleixner <tglx@kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/urgent] timers: Clear pending_map on CPU hotplug
Date: Tue, 20 Oct 2026 13:32:00 -0000	[thread overview]
Message-ID: <179250312063.3012171.15060379659597477402.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260930063621.37740-1-haohlliang@gmail.com>

The following commit has been merged into the timers/urgent branch of tip:

Commit-ID:     e7cad586d73276cbd4466de81b2092287d7475c0
Gitweb:        https://git.kernel.org/tip/e7cad586d73276cbd4466de81b2092287d7475c0
Author:        Liang Hao <haohlliang@gmail.com>
AuthorDate:    Wed, 30 Sep 2026 14:36:21 +08:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Tue, 20 Oct 2026 15:28:14 +02:00

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
---
 kernel/time/timer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index ae9abf1..fc37444 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);

      reply	other threads:[~2026-10-20 13:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-23 11:50 [PATCH] " Liang Hao
2026-08-24 15:21 ` Liang Hao
2026-09-29 20:08 ` Thomas Gleixner
2026-09-30  6:26   ` Liang Hao
2026-09-30  6:36 ` [PATCH v2] " Liang Hao
2026-10-20 13:32   ` tip-bot2 for Liang Hao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179250312063.3012171.15060379659597477402.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=haohlliang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®