linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH REPOST] irq_poll: Add local_bh_disable() in cpu_dead notifier
@ 2022-02-08 14:34 Sebastian Andrzej Siewior
  2022-02-09  7:56 ` Christoph Hellwig
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastian Andrzej Siewior @ 2022-02-08 14:34 UTC (permalink / raw)
  To: linux-kernel, linux-scsi
  Cc: Peter Zijlstra, Thomas Gleixner, Christoph Hellwig,
	Greg Kroah-Hartman, Andrew Morton

__raise_softirq_irqoff() adds a bit to the pending sofirq mask and this
is it. The softirq won't be handled in a deterministic way but randomly
when an interrupt fires and handles the softirq in its irq_exit() routine or
if something randomly checks and handles pending softirqs in the call
chain before the CPU goes idle.

Add a local_bh_disable/enable() around the IRQ-off section which will
handle pending softirqs.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
Repost of 
     https://lkml.kernel.org/r/20210930103754.2128949-1-bigeasy@linutronix.de

 lib/irq_poll.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/lib/irq_poll.c
+++ b/lib/irq_poll.c
@@ -191,11 +191,13 @@ static int irq_poll_cpu_dead(unsigned in
 	 * If a CPU goes away, splice its entries to the current CPU
 	 * and trigger a run of the softirq
 	 */
+	local_bh_disable();
 	local_irq_disable();
 	list_splice_init(&per_cpu(blk_cpu_iopoll, cpu),
 			 this_cpu_ptr(&blk_cpu_iopoll));
 	__raise_softirq_irqoff(IRQ_POLL_SOFTIRQ);
 	local_irq_enable();
+	local_bh_enable();
 
 	return 0;
 }

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

end of thread, other threads:[~2022-04-13 19:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-08 14:34 [PATCH REPOST] irq_poll: Add local_bh_disable() in cpu_dead notifier Sebastian Andrzej Siewior
2022-02-09  7:56 ` Christoph Hellwig
2022-02-10 12:33   ` Sebastian Andrzej Siewior
2022-02-11  6:34     ` Christoph Hellwig
2022-02-11 15:09       ` Sebastian Andrzej Siewior
2022-04-10 12:44       ` Thomas Gleixner
2022-04-10 12:49         ` [PATCH V2] lib/irq_poll: Add local_bh_disable() in irq_poll_cpu_dead() Thomas Gleixner
2022-04-13 19:38           ` [tip: core/core] lib/irq_poll: Prevent softirq pending leak " tip-bot2 for Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).