lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1dc4fa0a48b05e14a1ae2a751441ba021ecee286.camel@lenze.com>
Date: Wed, 28 Aug 2024 13:26:42 +0000
From: "Brandt, Oliver - Lenze" <oliver.brandt@...ze.com>
To: "bigeasy@...utronix.de" <bigeasy@...utronix.de>
CC: "tglx@...utronix.de" <tglx@...utronix.de>, "peterz@...radead.org"
	<peterz@...radead.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] irq_work: Avoid unnecessary "IRQ work" interrupts

On Wed, 2024-08-28 at 11:54 +0200, Sebastian Andrzej Siewior wrote:
> On 2024-08-28 11:37:20 [+0200], To Brandt, Oliver - Lenze wrote:
> > > Fixes: b4c6f86ec2f6 ('irq_work: Handle some irq_work in a per-CPU thread on PREEMPT_RT')
> > > Signed-off-by: Oliver Brandt <oliver.brandt@...ze.com>
> > > ---
> > >  kernel/irq_work.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/kernel/irq_work.c b/kernel/irq_work.c
> > > index 2f4fb336dda1..df08b7dde7d5 100644
> > > --- a/kernel/irq_work.c
> > > +++ b/kernel/irq_work.c
> > > @@ -108,7 +108,7 @@ static void __irq_work_queue_local(struct irq_work *work)
> > >                 return;
> > > 
> > >         /* If the work is "lazy", handle it from next tick if any */
> > > -       if (!lazy_work || tick_nohz_tick_stopped())
> > > +       if (!(lazy_work || rt_lazy_work) || tick_nohz_tick_stopped())
> > >                 irq_work_raise(work);
> > 
> > Looking at this I *think* rt_lazy_work was needed earlier due to
> > different code but not anymore. Couldn't you just remove rt_lazy_work
> > and set lazy_work in the RT path? That should work.
> 
> Actually no. If we merge rt_lazy_work into lazy_work then we would have
> the behaviour you have here. But we need irq_work_raise() in order to
>         irq_work_run();
>         -> wake_irq_workd();
>           -> wake_up_process(irq_workd);
> 
> If we don't irq_work_raise() here then it will be delayed until the next
> tick and we didn't want that if my memory serves me.

Hmm.... I see. What about calling wake_irq_workd() directly; something
like

        if (rt_lazy_work)
                wake_irq_workd();
        else if (!lazy_work || tick_nohz_tick_stopped())
                irq_work_raise(work);

> 
> Sebastian

Regards,
Oliver

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ