lkml.org 
[lkml]   [2020]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] irq_poll: Use raise_softirq_irqoff() in cpu_dead notifier
__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@linutronix.de>
---

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
\
 
 \ /
  Last update: 2020-04-02 21:51    [W:0.040 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site