The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Zqiang" <qiang.zhang@linux.dev>
To: "Bradley Morgan" <include@grrlz.net>
Cc: jiangshanlai@gmail.com, linux-kernel@vger.kernel.org, tj@kernel.org
Subject: Re: [PATCH] workqueue: Use raise_softirq() to trigger softirq in irq_work handler
Date: Fri, 17 Jul 2026 13:52:28 +0000	[thread overview]
Message-ID: <0c1659f8765a3bc44a47157200f48cea8ca07252@linux.dev> (raw)
In-Reply-To: <732F2B41-9D8D-443E-B199-231DC692D515@grrlz.net>

> 
> > 
> > The bh_pool_kick_normal() and bh_pool_kick_highpri() are registered via
> >  init_irq_work() without IRQ_WORK_HARD_IRQ flag. On PREEMPT_RT, such
> >  work items are processed by the per-CPU irq_workd kthread in preemptible
> >  task context with IRQs enabled. However calling raise_softirq_irqoff()
> >  requires IRQS must be disabled, This commit therefore replace
> >  raise_softirq_irqoff() with raise_softirq() in irq_work handler.
> > 
> Hi zhang!
> 
> Could you add
> 
> Fixes: 4cb1ef64609f ("workqueue: Implement BH workqueues to eventually replace tasklets")
> 
> ?
> 
> Also, if you would like this to go to stable, could you write a small
> part of the description about the user-space effects and why this is
> bad?

The or_softirq_pending(nr) be translated into the following three
assembly instructions(arm64 platform):

ldr w0, [x18, #softirq_pending_offset]

by interrupt:
calling  __raise_softirq_irqoff(NET_RX_SOFTIRQ)

orr w0, w0, 1<< nr
str w0, [x18, #softirq_pending_offset] <-- still use old value, the NET_RX_SOFTIRQ maybe lose.


Thanks
Zqiang


> 
> After all changes.
> 
> Reviewed-by: Bradley Morgan <include@grrlz.net>
> 
> > 
> > Signed-off-by: Zqiang <qiang.zhang@linux.dev>
> >  ---
> >  kernel/workqueue.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> >  diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> >  index 78068ae8f28a..0bb978df0200 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.17.1
> > 
> Thanks!
>

  reply	other threads:[~2026-07-17 13:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16  9:56 [PATCH] workqueue: Use raise_softirq() to trigger softirq in irq_work handler Zqiang
2026-07-16 16:41 ` Bradley Morgan
2026-07-17 13:52   ` Zqiang [this message]
2026-07-16 19:05 ` Tejun Heo
2026-07-17 13:55   ` Zqiang

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=0c1659f8765a3bc44a47157200f48cea8ca07252@linux.dev \
    --to=qiang.zhang@linux.dev \
    --cc=include@grrlz.net \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /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