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]
Date:   Fri, 12 Aug 2022 16:54:04 -0400
From:   Felix Kuehling <felix.kuehling@....com>
To:     Tejun Heo <tj@...nel.org>
Cc:     Philip Yang <Philip.Yang@....com>,
        Lai Jiangshan <jiangshanlai@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "amd-gfx@...ts.freedesktop.org" <amd-gfx@...ts.freedesktop.org>,
        Maling list - DRI developers 
        <dri-devel@...ts.freedesktop.org>, Dave Airlie <airlied@...il.com>
Subject: Re: Selecting CPUs for queuing work on

On 2022-08-12 16:30, Tejun Heo wrote:
> On Fri, Aug 12, 2022 at 04:26:47PM -0400, Felix Kuehling wrote:
>> Hi workqueue maintainers,
>>
>> In the KFD (amdgpu) driver we found a need to schedule bottom half interrupt
>> handlers on CPU cores different from the one where the top-half interrupt
>> handler runs to avoid the interrupt handler stalling the bottom half in
>> extreme scenarios. See my latest patch that tries to use a different
>> hyperthread on the same CPU core, or falls back to a different core in the
>> same NUMA node if that fails:
>> https://lore.kernel.org/all/20220811190433.1213179-1-Felix.Kuehling@amd.com/
>>
>> Dave pointed out that the driver may not be the best place to implement such
>> logic and suggested that we should have an abstraction, maybe in the
>> workqueue code. Do you feel this is something that could or should be
>> provided by the core workqueue code? Or maybe some other place?
> I'm not necessarily against it. I guess it can be a flag on an unbound wq.
> Do the interrupts move across different CPUs tho? ie. why does this need to
> be a dynamic decision?
In principle, I think IRQ routing to CPUs can change dynamically with 
irqbalance.

If this were a flag, would there be a way to ensure all work queued to 
the same workqueue from the same CPU, or maybe all work associated with 
a work_struct always goes to the same CPU? One of the reasons for my 
latest patch was to get more predictable scheduling of the work to cores 
that are specifically reserved for interrupt handling by the system 
admin. This minimizes CPU scheduling noise that can compound to cause 
real performance issues in large scale distributed applications.

What we need is kind of the opposite of WQ_UNBOUND. As I understand it, 
WQ_UNBOUND can schedule anywhere to maximize concurrency. What we need 
is to schedule to very specific, predictable CPUs. We only have one work 
item per GPU that processes all the interrupts in order, so we don't 
need the concurrency of WQ_UNBOUND.

Regards,
   Felix


>
> Thanks.
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ