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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yv5okqzH92iPytgl@linutronix.de>
Date:   Thu, 18 Aug 2022 18:28:02 +0200
From:   Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:     Schspa Shi <schspa@...il.com>
Cc:     rostedt@...dmis.org, linux-kernel@...r.kernel.org,
        linux-rt-users@...r.kernel.org
Subject: Re: [RFC PATCH] irq_work: wakeup irq_workd when queued first rt_lazy
 work

On 2022-07-12 01:23:15 [+0800], Schspa Shi wrote:
> I want to know if this difference is by design.

Yes. type1 (LAZY) does not need immediate action but can't be scheduled
regularly like a workqueue.

> If this is by design, we have a problem that the irq_work of type2
> will not execute as quickly as expected, it may be delayed by the
> irq_work of type1.
> 
> Please consider the following scenarios:
> 
> If the CPU queued a type1 irq_work A, and then a type2 irq_work B.
> But we won't make B executed quickly, because we won't issue the IPI
> interrupt to wakeup irq_workd (the llist_add call will return false).

But those two are different lists. So adding type1 to list1 does not
affect type2 with list2

> This PATCH will issue the IPI_IRQ_WORK to make B execute quickly.
> 
> One thing that needs to be optimized is that we now have
> lazy_list.node.llist and lazy_work_raised which need to be granted
> to be atomicity, disabled the local CPU IRQ to make this atomic.
> There should be a better way to make these two variants to be atomically
> and I can go in deep if this little problem is not by design, and need
> to be fixed.
> 
> If these two types of irq_work should be the same with the priority.
> maybe we should change.
> 
> if (!lazy_work || tick_nohz_tick_stopped()) {
> 	arch_irq_work_raise();
> }
> 
> to
> 
> if (!(lazy_work || rt_lazy_work) || tick_nohz_tick_stopped()) {
> 	arch_irq_work_raise();
> }

but we wait for the timer for the lazy-work. RT has more LAZY items
compared to !RT. So if there is an error then it should be visible
there, too.

Is there a problem with this? Adding (as you call it) type1 item does
not affect type2 items. They will will processed asap.

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ