Linux MM tree latest commits
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, tglx@linutronix.de,
	peterz@infradead.org, hch@infradead.org,
	gregkh@linuxfoundation.org, bigeasy@linutronix.de,
	akpm@linux-foundation.org
Subject: + lib-irq_poll-add-local_bh_disable-in-irq_poll_cpu_dead.patch added to -mm tree
Date: Tue, 12 Apr 2022 16:15:37 -0700	[thread overview]
Message-ID: <20220412231538.82432C385A1@smtp.kernel.org> (raw)


The patch titled
     Subject: lib/irq_poll: Add local_bh_disable() in irq_poll_cpu_dead()
has been added to the -mm tree.  Its filename is
     lib-irq_poll-add-local_bh_disable-in-irq_poll_cpu_dead.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/lib-irq_poll-add-local_bh_disable-in-irq_poll_cpu_dead.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/lib-irq_poll-add-local_bh_disable-in-irq_poll_cpu_dead.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: lib/irq_poll: Add local_bh_disable() in irq_poll_cpu_dead()

irq_poll_cpu_dead() pulls the blk_cpu_iopoll backlog from the dead CPU and
raises the POLL softirq with __raise_softirq_irqoff() on the CPU it is
running on.  That just sets the bit in the pending softirq mask.

This means the handling of the softirq is delayed until the next interrupt
or a local_bh_disable/enable() pair.  As a consequence the CPU on which
this code runs can reach idle with the POLL softirq pending, which
triggers a warning in the NOHZ idle code.

Add a local_bh_disable/enable() pair around the interrupts disabled
section in irq_poll_cpu_dead().  local_bh_enable will handle the pending
softirq.

[@linutronix.de: massaged changelog and comment]
Link: https://lkml.kernel.org/r/87k0bxgl27.ffs@tglx
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---


--- a/lib/irq_poll.c~lib-irq_poll-add-local_bh_disable-in-irq_poll_cpu_dead
+++ a/lib/irq_poll.c
@@ -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;
 }
_

Patches currently in -mm which might be from bigeasy@linutronix.de are

lib-irq_poll-add-local_bh_disable-in-irq_poll_cpu_dead.patch


                 reply	other threads:[~2022-04-12 23:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220412231538.82432C385A1@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=bigeasy@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox