[PATCH] irq_poll: Use raise_softirq_irqoff() in cpu_dead notifier
From: Sebastian Andrzej Siewior
Date: Thu Apr 02 2020 - 15:50:33 EST
__raise_softirq_irqoff() adds a pending sofirq mask and this is it. The
softirq won't be invoked unless something checks for a pending softirq
which should happen once the next interrupt fires. The CPU might go
idle in the meantime.
Use raise_softirq_irqoff() to wake ksoftirqd() if the list has work
items pending.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
---
Maybe preempt_check_resched() should be added to act on a possible
need_resched flag. Otherwise it will be delayed to the next
cond_resched() / spin_unlock().
lib/irq_poll.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/irq_poll.c b/lib/irq_poll.c
index 2f17b488d58e1..484dbd2aa09fb 100644
--- a/lib/irq_poll.c
+++ b/lib/irq_poll.c
@@ -194,7 +194,8 @@ static int irq_poll_cpu_dead(unsigned int cpu)
local_irq_disable();
list_splice_init(&per_cpu(blk_cpu_iopoll, cpu),
this_cpu_ptr(&blk_cpu_iopoll));
- __raise_softirq_irqoff(IRQ_POLL_SOFTIRQ);
+ if (!list_empty(this_cpu_ptr(&blk_cpu_iopoll)))
+ raise_softirq_irqoff(IRQ_POLL_SOFTIRQ);
local_irq_enable();
return 0;
--
2.26.0