mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <mka@chromium.org>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Steven Rostedt <rostedt@goodmis.org>,
	"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-kernel@vger.kernel.org,
	Douglas Anderson <dianders@chromium.org>,
	Stephen Boyd <swboyd@chromium.org>,
	Matthias Kaehlcke <mka@chromium.org>
Subject: [PATCH 2/2] softirq: Don't skip softirq execution when softirq thread is parking
Date: Mon, 28 Jan 2019 15:46:25 -0800	[thread overview]
Message-ID: <20190128234625.78241-3-mka@chromium.org> (raw)
In-Reply-To: <20190128234625.78241-1-mka@chromium.org>

When a CPU is unplugged the kernel threads of this CPU are parked
(see smpboot_park_threads()). kthread_park() is used to mark each
thread as parked and wake it up, so it can complete the process of
parking itselfs (see smpboot_thread_fn()).

If local softirqs are pending on interrupt exit invoke_softirq() is
called to process the softirqs, however it skips processing when the
softirq kernel thread of the local CPU is scheduled to run. The
softirq kthread is one of the threads that is parked when a CPU is
unplugged. Parking the kthread wakes it up, however only to complete
the parking process, not to process the pending softirqs. Hence
processing of softirqs at the end of an interrupt is skipped, but
not done elsewhere, which can result in warnings about pending
softirqs when a CPU is unplugged:

/sys/devices/system/cpu # echo 0 > cpu4/online
[ ... ] NOHZ: local_softirq_pending 02
[ ... ] NOHZ: local_softirq_pending 202
[ ... ] CPU4: shutdown
[ ... ] psci: CPU4 killed.

Don't skip processing of softirqs at the end of an interrupt when
the softirq thread of the CPU is parking.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
 kernel/softirq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/softirq.c b/kernel/softirq.c
index d28813306b2c2..10277429ed84f 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -89,7 +89,8 @@ static bool ksoftirqd_running(unsigned long pending)
 
 	if (pending & SOFTIRQ_NOW_MASK)
 		return false;
-	return tsk && (tsk->state == TASK_RUNNING);
+	return tsk && (tsk->state == TASK_RUNNING) &&
+		!__kthread_should_park(tsk);
 }
 
 /*
-- 
2.20.1.495.gaa96b0ce6b-goog


  parent reply	other threads:[~2019-01-28 23:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-28 23:46 [PATCH 0/2] " Matthias Kaehlcke
2019-01-28 23:46 ` [PATCH 1/2] kthread: Add __kthread_should_park() Matthias Kaehlcke
2019-02-10 20:56   ` [tip:irq/core] " tip-bot for Matthias Kaehlcke
2019-01-28 23:46 ` Matthias Kaehlcke [this message]
2019-02-10 20:57   ` [tip:irq/core] softirq: Don't skip softirq execution when softirq thread is parking tip-bot for Matthias Kaehlcke

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=20190128234625.78241-3-mka@chromium.org \
    --to=mka@chromium.org \
    --cc=bigeasy@linutronix.de \
    --cc=dianders@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=swboyd@chromium.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

all inboxes | Powered by JetHome®