* [PATCH] workqueue: Use raise_softirq() in bh_pool_kick_.*()
@ 2026-08-19 14:19 Sebastian Andrzej Siewior
2026-08-19 14:34 ` Bradley Morgan
2026-08-19 20:41 ` Tejun Heo
0 siblings, 2 replies; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2026-08-19 14:19 UTC (permalink / raw)
To: Tejun Heo; +Cc: Lai Jiangshan, Thomas Gleixner, Peter Zijlstra, linux-kernel
bh_pool_kick_normal() is used as irq_work callback to schedule softirq
on a remote CPU.
On PREEMPT_RT the default irq_work item is initialized as IRQ_WORK_LAZY
and is invoked in a thread with enabled interrupts (!RT would use
softirq but interrupts would remain enabled). This triggers the warning
in raise_softirq_irqoff() which expects interrupts to off while the
softirq irq mask is modified.
The kick function triggers an IPI and the remote CPU
wakes of irq_work/ and the callback wakes ksoftirqd/.
By initialising the irq_work as IRQ_WORK_INIT_HARD via
| *bh_pool_irq_work(pool) = IRQ_WORK_INIT_HARD(irq_work_fns[i]);
we get the IPI and either (directly) a wake of ksoftirqd or "injected"
the softirq into the current context if it is already in BH-disabled
context which is in general undesired.
Even if ksoftirqd is woken up, the softirq work could be picked up by
random task which decided to do softirqs and then "drains" the pending
queue.
Scheduling a remote BH-work is undesired because of the possible context
stealing. Using raise_softirq() here avoids the warning. As of today I
did not see any users.
Use raise_softirq() in bh_pool_kick_.*() to avoid a warning in
PREEMPT_RT.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/workqueue.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 78068ae8f28a6..0bb978df02005 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -7923,12 +7923,12 @@ static inline void wq_watchdog_init(void) { }
static void bh_pool_kick_normal(struct irq_work *irq_work)
{
- raise_softirq_irqoff(TASKLET_SOFTIRQ);
+ raise_softirq(TASKLET_SOFTIRQ);
}
static void bh_pool_kick_highpri(struct irq_work *irq_work)
{
- raise_softirq_irqoff(HI_SOFTIRQ);
+ raise_softirq(HI_SOFTIRQ);
}
static void __init restrict_unbound_cpumask(const char *name, const struct cpumask *mask)
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] workqueue: Use raise_softirq() in bh_pool_kick_.*()
2026-08-19 14:19 [PATCH] workqueue: Use raise_softirq() in bh_pool_kick_.*() Sebastian Andrzej Siewior
@ 2026-08-19 14:34 ` Bradley Morgan
2026-08-19 19:29 ` Tejun Heo
2026-08-19 20:41 ` Tejun Heo
1 sibling, 1 reply; 6+ messages in thread
From: Bradley Morgan @ 2026-08-19 14:34 UTC (permalink / raw)
To: bigeasy; +Cc: jiangshanlai, linux-kernel, peterz, tglx, tj
On 19 August 2026 15:19:09 BST, Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
>bh_pool_kick_normal() is used as irq_work callback to schedule softirq
>on a remote CPU.
>On PREEMPT_RT the default irq_work item is initialized as IRQ_WORK_LAZY
>and is invoked in a thread with enabled interrupts (!RT would use
>softirq but interrupts would remain enabled). This triggers the warning
>in raise_softirq_irqoff() which expects interrupts to off while the
>softirq irq mask is modified.
>
>The kick function triggers an IPI and the remote CPU
>wakes of irq_work/ and the callback wakes ksoftirqd/.
>
>By initialising the irq_work as IRQ_WORK_INIT_HARD via
>| *bh_pool_irq_work(pool) = IRQ_WORK_INIT_HARD(irq_work_fns[i]);
>we get the IPI and either (directly) a wake of ksoftirqd or "injected"
>the softirq into the current context if it is already in BH-disabled
>context which is in general undesired.
>Even if ksoftirqd is woken up, the softirq work could be picked up by
>random task which decided to do softirqs and then "drains" the pending
>queue.
>
>Scheduling a remote BH-work is undesired because of the possible context
>stealing. Using raise_softirq() here avoids the warning. As of today I
>did not see any users.
>
>Use raise_softirq() in bh_pool_kick_.*() to avoid a warning in
>PREEMPT_RT.
>
Well, sure, me personally don't see any issues in this code, makes life
easier
Reviewed-by: Bradley Morgan <include@grrlz.net>
>Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>---
> kernel/workqueue.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/kernel/workqueue.c b/kernel/workqueue.c
>index 78068ae8f28a6..0bb978df02005 100644
>--- a/kernel/workqueue.c
>+++ b/kernel/workqueue.c
>@@ -7923,12 +7923,12 @@ static inline void wq_watchdog_init(void) { }
>
> static void bh_pool_kick_normal(struct irq_work *irq_work)
> {
>- raise_softirq_irqoff(TASKLET_SOFTIRQ);
>+ raise_softirq(TASKLET_SOFTIRQ);
> }
>
> static void bh_pool_kick_highpri(struct irq_work *irq_work)
> {
>- raise_softirq_irqoff(HI_SOFTIRQ);
>+ raise_softirq(HI_SOFTIRQ);
> }
>
> static void __init restrict_unbound_cpumask(const char *name, const
> struct cpumask *mask)
>
Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] workqueue: Use raise_softirq() in bh_pool_kick_.*()
2026-08-19 14:34 ` Bradley Morgan
@ 2026-08-19 19:29 ` Tejun Heo
2026-08-19 19:36 ` Bradley Morgan
0 siblings, 1 reply; 6+ messages in thread
From: Tejun Heo @ 2026-08-19 19:29 UTC (permalink / raw)
To: Bradley Morgan; +Cc: bigeasy, jiangshanlai, linux-kernel, peterz, tglx
On Wed, Aug 19, 2026 at 03:34:00PM +0100, Bradley Morgan wrote:
> Well, sure, me personally don't see any issues in this code, makes life
> easier
>
> Reviewed-by: Bradley Morgan <include@grrlz.net>
I've been getting these review responses without much content on patches
across multiple subsystems. I'm leaning towards ignoring going forward. If
I'm jumping the gun prematurely, please let me know.
--
tejun
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] workqueue: Use raise_softirq() in bh_pool_kick_.*()
2026-08-19 19:29 ` Tejun Heo
@ 2026-08-19 19:36 ` Bradley Morgan
0 siblings, 0 replies; 6+ messages in thread
From: Bradley Morgan @ 2026-08-19 19:36 UTC (permalink / raw)
To: Tejun Heo; +Cc: bigeasy, jiangshanlai, linux-kernel, peterz, tglx
On 19 August 2026 20:29:52 BST, Tejun Heo <tj@kernel.org> wrote:
>On Wed, Aug 19, 2026 at 03:34:00PM +0100, Bradley Morgan wrote:
>> Well, sure, me personally don't see any issues in this code, makes life
>> easier
>>
>> Reviewed-by: Bradley Morgan <include@grrlz.net>
>
>I've been getting these review responses without much content on patches
>across multiple subsystems. I'm leaning towards ignoring going forward. If
>I'm jumping the gun prematurely, please let me know.
>
Hmm, hold on before u "jump the gun", I learn based on other maintainers
reviews, some just do a LGTM, and then the tag, which I see as
appropriate, if you don't agree with that, you could have told me..
Whatever you want me to do, I'll happily do it, wether it's more
context in the review, or doing other things, please please please tell
me,
I am a learning reviewer, and I am interested in kernel/ (in some cases,
subdirectories), I am sorry if this looks suspicious or odd to you, just
please tell me what you are finding flawed about my reviews, or just
wrong,so that I could iprove
>
Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] workqueue: Use raise_softirq() in bh_pool_kick_.*()
2026-08-19 14:19 [PATCH] workqueue: Use raise_softirq() in bh_pool_kick_.*() Sebastian Andrzej Siewior
2026-08-19 14:34 ` Bradley Morgan
@ 2026-08-19 20:41 ` Tejun Heo
2026-08-20 6:16 ` Sebastian Andrzej Siewior
1 sibling, 1 reply; 6+ messages in thread
From: Tejun Heo @ 2026-08-19 20:41 UTC (permalink / raw)
To: Sebastian Andrzej Siewior
Cc: Lai Jiangshan, Thomas Gleixner, Peter Zijlstra, linux-kernel
Hello, Sebastian.
On Wed, Aug 19, 2026 at 04:19:09PM +0200, Sebastian Andrzej Siewior wrote:
> Use raise_softirq() in bh_pool_kick_.*() to avoid a warning in
> PREEMPT_RT.
The same fix was applied last month:
df42c49ec865 ("workqueue: Use raise_softirq() to trigger softirq in
irq_work handler")
but I mistakenly applied it to the already closed for-7.1-fixes branch
and it never reached mainline. It's now cherry-picked to
wq/for-7.3-fixes and will go to mainline and then -stable this cycle.
Thanks for the fix and sorry about the confusion.
--
tejun
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] workqueue: Use raise_softirq() in bh_pool_kick_.*()
2026-08-19 20:41 ` Tejun Heo
@ 2026-08-20 6:16 ` Sebastian Andrzej Siewior
0 siblings, 0 replies; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2026-08-20 6:16 UTC (permalink / raw)
To: Tejun Heo; +Cc: Lai Jiangshan, Thomas Gleixner, Peter Zijlstra, linux-kernel
On 2026-08-19 10:41:44 [-1000], Tejun Heo wrote:
> Hello, Sebastian.
Hi,
> On Wed, Aug 19, 2026 at 04:19:09PM +0200, Sebastian Andrzej Siewior wrote:
> > Use raise_softirq() in bh_pool_kick_.*() to avoid a warning in
> > PREEMPT_RT.
>
> The same fix was applied last month:
>
> df42c49ec865 ("workqueue: Use raise_softirq() to trigger softirq in
> irq_work handler")
>
> but I mistakenly applied it to the already closed for-7.1-fixes branch
> and it never reached mainline. It's now cherry-picked to
> wq/for-7.3-fixes and will go to mainline and then -stable this cycle.
> Thanks for the fix and sorry about the confusion.
no worries.
Sebastian
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-08-20 6:16 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19 14:19 [PATCH] workqueue: Use raise_softirq() in bh_pool_kick_.*() Sebastian Andrzej Siewior
2026-08-19 14:34 ` Bradley Morgan
2026-08-19 19:29 ` Tejun Heo
2026-08-19 19:36 ` Bradley Morgan
2026-08-19 20:41 ` Tejun Heo
2026-08-20 6:16 ` Sebastian Andrzej Siewior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.