Skip to content

Commit

Permalink
irq_poll: Use raise_softirq_irqoff() in cpu_dead notifier
Browse files Browse the repository at this point in the history
__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 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>
Link: https://lkml.kernel.org/r/20210930103754.2128949-1-bigeasy@linutronix.de
  • Loading branch information
Sebastian Andrzej Siewior committed Sep 30, 2021
1 parent ab2154c commit 6faa4db
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/irq_poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,13 @@ static int irq_poll_cpu_dead(unsigned int cpu)
* 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;
}
Expand Down

0 comments on commit 6faa4db

Please sign in to comment.