Commit 4b57dccc authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'core-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irqpoll update from Thomas Gleixner:
 "A single update for irqpoll:

  Ensure that a raised soft interrupt is handled after pulling the
  blk_cpu_iopoll backlog from a unplugged CPU. This prevents that the
  CPU which runs that code reaches idle with soft interrupts pending"

* tag 'core-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  lib/irq_poll: Prevent softirq pending leak in irq_poll_cpu_dead()
parents 140e40e3 75d8cce1
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -188,14 +188,18 @@ EXPORT_SYMBOL(irq_poll_init);
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
	 * If a CPU goes away, splice its entries to the current CPU and
	 * set the POLL softirq bit. The local_bh_disable()/enable() pair
	 * ensures that it is handled. Otherwise the current CPU could
	 * reach idle with the POLL softirq pending.
	 */
	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;
}