From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH] irq_poll: Use raise_softirq_irqoff() in cpu_dead notifier
Date: Thu, 2 Apr 2020 21:50:28 +0200 [thread overview]
Message-ID: <20200402195028.skpufyn4c6ktgai3@linutronix.de> (raw)
__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
next reply other threads:[~2020-04-02 19:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-02 19:50 Sebastian Andrzej Siewior [this message]
2021-09-30 10:37 [PATCH] irq_poll: Use raise_softirq_irqoff() in cpu_dead notifier Sebastian Andrzej Siewior
2021-10-18 7:45 ` Sebastian Andrzej Siewior
2021-10-18 10:53 ` Christoph Hellwig
2021-10-18 11:49 ` Sebastian Andrzej Siewior
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=20200402195028.skpufyn4c6ktgai3@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--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;
as well as URLs for NNTP newsgroup(s).