mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tick/block: Add BLOCK_SOFTIRQ to the hotplug safe mask
@ 2026-09-04  6:45 Wang Shuaiwei
  2026-09-17  9:30 ` Wang Shuaiwei
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Wang Shuaiwei @ 2026-09-04  6:45 UTC (permalink / raw)
  To: Frederic Weisbecker, Thomas Gleixner, Jens Axboe
  Cc: Sebastian Andrzej Siewior, wanghui33, Wang Shuaiwei,
	linux-kernel, linux-block

During CPU-hotplug stress testing combined with an I/O
workload, the following message is observed:

  "NOHZ tick-stop error: local softirq work is pending, handler #10!!!"

On CPU offline, ksoftirqd is parked at CPUHP_AP_SMPBOOT_THREADS while
the CPU still takes interrupts. A block completion raised after that
point stays pending, and if the dying CPU goes idle before teardown,
report_idle_softirq() sees it, keeps the tick alive and prints the
error above.

Such pending block completions on the outgoing CPU are drained later by
blk_softirq_cpu_dead() (CPUHP_BLOCK_SOFTIRQ_DEAD), so a pending
BLOCK_SOFTIRQ is harmless here. Add it to SOFTIRQ_HOTPLUG_SAFE_MASK
like the other teardown-covered vectors.

Signed-off-by: Wang Shuaiwei <wangshuaiwei1@xiaomi.com>
---
 include/linux/interrupt.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 3bf969ad8fe0..52bb684090c0 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -573,9 +573,11 @@ enum
  * _ IRQ_POLL: irq_poll_cpu_dead() migrates the queue
  *
  * _ (HR)TIMER_SOFTIRQ: (hr)timers_dead_cpu() migrates the queue
+ *
+ * _ BLOCK_SOFTIRQ: blk_softirq_cpu_dead() completes the remaining requests
  */
-#define SOFTIRQ_HOTPLUG_SAFE_MASK (BIT(TIMER_SOFTIRQ) | BIT(IRQ_POLL_SOFTIRQ) |\
-				   BIT(HRTIMER_SOFTIRQ) | BIT(RCU_SOFTIRQ))
+#define SOFTIRQ_HOTPLUG_SAFE_MASK (BIT(TIMER_SOFTIRQ) | BIT(BLOCK_SOFTIRQ) |\
+				   BIT(IRQ_POLL_SOFTIRQ) | BIT(HRTIMER_SOFTIRQ) | BIT(RCU_SOFTIRQ))
 
 
 /* map softirq index to softirq name. update 'softirq_to_name' in
-- 
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] tick/block: Add BLOCK_SOFTIRQ to the hotplug safe mask
  2026-09-04  6:45 [PATCH] tick/block: Add BLOCK_SOFTIRQ to the hotplug safe mask Wang Shuaiwei
@ 2026-09-17  9:30 ` Wang Shuaiwei
  2026-09-17  9:51 ` Sebastian Andrzej Siewior
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Wang Shuaiwei @ 2026-09-17  9:30 UTC (permalink / raw)
  To: axboe, bigeasy, frederic
  Cc: linux-block, linux-kernel, tglx, wanghui33, wangshuaiwei1

On Fri, 4 Sep 2026 14:45:06 +0800, Wang Shuaiwei wrote:
> During CPU-hotplug stress testing combined with an I/O
> workload, the following message is observed:
> 
>   "NOHZ tick-stop error: local softirq work is pending, handler #10!!!"
> 
> On CPU offline, ksoftirqd is parked at CPUHP_AP_SMPBOOT_THREADS while
> the CPU still takes interrupts. A block completion raised after that
> ...

Hi,

Just wanted to follow up on this patch.
I'd appreciate any feedback or suggestions when you get a chance.

Thanks,
Shuaiwei

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] tick/block: Add BLOCK_SOFTIRQ to the hotplug safe mask
  2026-09-04  6:45 [PATCH] tick/block: Add BLOCK_SOFTIRQ to the hotplug safe mask Wang Shuaiwei
  2026-09-17  9:30 ` Wang Shuaiwei
@ 2026-09-17  9:51 ` Sebastian Andrzej Siewior
  2026-09-18 10:39   ` Wang Shuaiwei
  2026-09-18 12:42 ` Frederic Weisbecker
  2026-09-19 21:05 ` [tip: timers/nohz] tick/nohz: " tip-bot2 for Wang Shuaiwei
  3 siblings, 1 reply; 7+ messages in thread
From: Sebastian Andrzej Siewior @ 2026-09-17  9:51 UTC (permalink / raw)
  To: Wang Shuaiwei
  Cc: Frederic Weisbecker, Thomas Gleixner, Jens Axboe, wanghui33,
	linux-kernel, linux-block

On 2026-09-04 14:45:06 [+0800], Wang Shuaiwei wrote:
> During CPU-hotplug stress testing combined with an I/O
> workload, the following message is observed:
> 
>   "NOHZ tick-stop error: local softirq work is pending, handler #10!!!"
> 
> On CPU offline, ksoftirqd is parked at CPUHP_AP_SMPBOOT_THREADS while
> the CPU still takes interrupts. A block completion raised after that
> point stays pending, and if the dying CPU goes idle before teardown,
> report_idle_softirq() sees it, keeps the tick alive and prints the
> error above.
> 
> Such pending block completions on the outgoing CPU are drained later by
> blk_softirq_cpu_dead() (CPUHP_BLOCK_SOFTIRQ_DEAD), so a pending
> BLOCK_SOFTIRQ is harmless here. Add it to SOFTIRQ_HOTPLUG_SAFE_MASK
> like the other teardown-covered vectors.
> 
> Signed-off-by: Wang Shuaiwei <wangshuaiwei1@xiaomi.com>

Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Should this go via nohz, softirq or block?

Sebastian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] tick/block: Add BLOCK_SOFTIRQ to the hotplug safe mask
  2026-09-17  9:51 ` Sebastian Andrzej Siewior
@ 2026-09-18 10:39   ` Wang Shuaiwei
  0 siblings, 0 replies; 7+ messages in thread
From: Wang Shuaiwei @ 2026-09-18 10:39 UTC (permalink / raw)
  To: bigeasy, axboe, frederic
  Cc: linux-block, linux-kernel, tglx, wanghui33, wangshuaiwei1

On Thu, 17 Sep 2026 11:51:10 +0200, Sebastian Andrzej Siewior wrote:
> Should this go via nohz, softirq or block?

I'd prefer it to go through the nohz tree since the change is in
SOFTIRQ_HOTPLUG_SAFE_MASK which lives in the NOHZ tick-stop path.

Jens, could you please have a look at this? The patch marks BLOCK_SOFTIRQ
as hotplug-safe, relying on blk_softirq_cpu_dead() to drain pending
completions during CPU offline. Just want to make sure the block layer
is comfortable with that assumption.

Thanks,
Shuaiwei

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] tick/block: Add BLOCK_SOFTIRQ to the hotplug safe mask
  2026-09-04  6:45 [PATCH] tick/block: Add BLOCK_SOFTIRQ to the hotplug safe mask Wang Shuaiwei
  2026-09-17  9:30 ` Wang Shuaiwei
  2026-09-17  9:51 ` Sebastian Andrzej Siewior
@ 2026-09-18 12:42 ` Frederic Weisbecker
  2026-09-19 21:05 ` [tip: timers/nohz] tick/nohz: " tip-bot2 for Wang Shuaiwei
  3 siblings, 0 replies; 7+ messages in thread
From: Frederic Weisbecker @ 2026-09-18 12:42 UTC (permalink / raw)
  To: Wang Shuaiwei
  Cc: Thomas Gleixner, Jens Axboe, Sebastian Andrzej Siewior,
	wanghui33, linux-kernel, linux-block

Le Fri, Sep 04, 2026 at 02:45:06PM +0800, Wang Shuaiwei a écrit :
> During CPU-hotplug stress testing combined with an I/O
> workload, the following message is observed:
> 
>   "NOHZ tick-stop error: local softirq work is pending, handler #10!!!"
> 
> On CPU offline, ksoftirqd is parked at CPUHP_AP_SMPBOOT_THREADS while
> the CPU still takes interrupts. A block completion raised after that
> point stays pending, and if the dying CPU goes idle before teardown,
> report_idle_softirq() sees it, keeps the tick alive and prints the
> error above.
> 
> Such pending block completions on the outgoing CPU are drained later by
> blk_softirq_cpu_dead() (CPUHP_BLOCK_SOFTIRQ_DEAD), so a pending
> BLOCK_SOFTIRQ is harmless here. Add it to SOFTIRQ_HOTPLUG_SAFE_MASK
> like the other teardown-covered vectors.
> 
> Signed-off-by: Wang Shuaiwei <wangshuaiwei1@xiaomi.com>

Reviewed-by: Frederic Weisbecker <frederic@kernel.org>

-- 
Frederic Weisbecker
SUSE Labs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tip: timers/nohz] tick/nohz: Add BLOCK_SOFTIRQ to the hotplug safe mask
  2026-09-04  6:45 [PATCH] tick/block: Add BLOCK_SOFTIRQ to the hotplug safe mask Wang Shuaiwei
                   ` (2 preceding siblings ...)
  2026-09-18 12:42 ` Frederic Weisbecker
@ 2026-09-19 21:05 ` tip-bot2 for Wang Shuaiwei
  2026-10-20 21:51   ` Thomas Gleixner
  3 siblings, 1 reply; 7+ messages in thread
From: tip-bot2 for Wang Shuaiwei @ 2026-09-19 21:05 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Wang Shuaiwei, Thomas Gleixner, Sebastian Andrzej Siewior,
	Frederic Weisbecker, x86, linux-kernel

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

Commit-ID:     a59a940ff89fcaf305362443335f99010ff3b9cf
Gitweb:        https://git.kernel.org/tip/a59a940ff89fcaf305362443335f99010ff3b9cf
Author:        Wang Shuaiwei <wangshuaiwei1@xiaomi.com>
AuthorDate:    Fri, 04 Sep 2026 14:45:06 +08:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Sat, 19 Sep 2026 23:01:14 +02:00

tick/nohz: Add BLOCK_SOFTIRQ to the hotplug safe mask

During CPU-hotplug stress testing combined with an I/O workload, the
following message is observed:

  "NOHZ tick-stop error: local softirq work is pending, handler #10!!!"

On CPU offline, ksoftirqd is parked at CPUHP_AP_SMPBOOT_THREADS while the
CPU still takes interrupts. A block completion raised after that point
stays pending, and if the dying CPU goes idle before teardown,
report_idle_softirq() sees it, keeps the tick alive and prints the error
above.

Such pending block completions on the outgoing CPU are drained later by
blk_softirq_cpu_dead() (CPUHP_BLOCK_SOFTIRQ_DEAD), so a pending
BLOCK_SOFTIRQ is harmless here. Add it to SOFTIRQ_HOTPLUG_SAFE_MASK like
the other teardown-covered vectors.

Signed-off-by: Wang Shuaiwei <wangshuaiwei1@xiaomi.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://patch.msgid.link/20260904064506.671203-1-wangshuaiwei1@xiaomi.com
---
 include/linux/interrupt.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 3bf969a..52bb684 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -573,9 +573,11 @@ enum
  * _ IRQ_POLL: irq_poll_cpu_dead() migrates the queue
  *
  * _ (HR)TIMER_SOFTIRQ: (hr)timers_dead_cpu() migrates the queue
+ *
+ * _ BLOCK_SOFTIRQ: blk_softirq_cpu_dead() completes the remaining requests
  */
-#define SOFTIRQ_HOTPLUG_SAFE_MASK (BIT(TIMER_SOFTIRQ) | BIT(IRQ_POLL_SOFTIRQ) |\
-				   BIT(HRTIMER_SOFTIRQ) | BIT(RCU_SOFTIRQ))
+#define SOFTIRQ_HOTPLUG_SAFE_MASK (BIT(TIMER_SOFTIRQ) | BIT(BLOCK_SOFTIRQ) |\
+				   BIT(IRQ_POLL_SOFTIRQ) | BIT(HRTIMER_SOFTIRQ) | BIT(RCU_SOFTIRQ))
 
 
 /* map softirq index to softirq name. update 'softirq_to_name' in

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [tip: timers/nohz] tick/nohz: Add BLOCK_SOFTIRQ to the hotplug safe mask
  2026-09-19 21:05 ` [tip: timers/nohz] tick/nohz: " tip-bot2 for Wang Shuaiwei
@ 2026-10-20 21:51   ` Thomas Gleixner
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Gleixner @ 2026-10-20 21:51 UTC (permalink / raw)
  To: tip-bot2 for Wang Shuaiwei, linux-tip-commits
  Cc: Wang Shuaiwei, Sebastian Andrzej Siewior, Frederic Weisbecker,
	x86, linux-kernel, Waiman Long

On Sat, Sep 19 2026 at 21:05, tip-bot wrote:
> tick/nohz: Add BLOCK_SOFTIRQ to the hotplug safe mask
>
> During CPU-hotplug stress testing combined with an I/O workload, the
> following message is observed:
>
>   "NOHZ tick-stop error: local softirq work is pending, handler #10!!!"
>
> On CPU offline, ksoftirqd is parked at CPUHP_AP_SMPBOOT_THREADS while the
> CPU still takes interrupts. A block completion raised after that point
> stays pending, and if the dying CPU goes idle before teardown,
> report_idle_softirq() sees it, keeps the tick alive and prints the error
> above.
>
> Such pending block completions on the outgoing CPU are drained later by
> blk_softirq_cpu_dead() (CPUHP_BLOCK_SOFTIRQ_DEAD), so a pending
> BLOCK_SOFTIRQ is harmless here. Add it to SOFTIRQ_HOTPLUG_SAFE_MASK like
> the other teardown-covered vectors.

In principle this is correct, but with partial hotplug it is not. It
might work by chance, but not by design.

Just use the sysfs interface to bring down the CPU to
CPUHP_AP_SCHED_WAIT_EMPTY. If a soft interrupt is raised in that state
which requires ksoftirqd then that might be delayed to the point where
an interrupt arrives and eventually handles it (or not).

That means all of this "safe" mask magic needs some thoughts.

Thanks,

        tglx



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-10-20 21:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-04  6:45 [PATCH] tick/block: Add BLOCK_SOFTIRQ to the hotplug safe mask Wang Shuaiwei
2026-09-17  9:30 ` Wang Shuaiwei
2026-09-17  9:51 ` Sebastian Andrzej Siewior
2026-09-18 10:39   ` Wang Shuaiwei
2026-09-18 12:42 ` Frederic Weisbecker
2026-09-19 21:05 ` [tip: timers/nohz] tick/nohz: " tip-bot2 for Wang Shuaiwei
2026-10-20 21:51   ` Thomas Gleixner

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®