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:   Mon, 21 Mar 2022 06:45:23 -1000
From:   Tejun Heo <tj@...nel.org>
To:     Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Lai Jiangshan <jiangshanlai@...il.com>
Subject: Re: An announcement for kernel-global workqueue users.

Hello, Tetsuo.

On Mon, Mar 21, 2022 at 10:24:23AM +0900, Tetsuo Handa wrote:
> Hello.
> 
> The Linux kernel provides kernel-global WQs (namely, system_wq, system_highpri_wq,
> system_long_wq, system_unbound_wq, system_freezable_wq, system_power_efficient_wq
> and system_freezable_power_efficient_wq). But since attempt to flush kernel-global
> WQs has possibility of deadlock, Tejun Heo thinks that we should stop calling
> flush_scheduled_work() and flush_workqueue(system_*). Such callers as of Linux 5.17
> are listed below.

Hey, so, I'm not too sure this approach would work. Someone would have to do
most of the legwork and ping the respective maintainers with proposed
patches explaining what's happening why and how the proposed patches are
safe.

> I tried to send a patch that emits a warning when flushing kernel-global WQs is attempted
> ( https://lkml.kernel.org/r/2efd5461-fccd-f1d9-7138-0a6767cbf5fe@I-love.SAKURA.ne.jp ).
> But Linus does not want such patch
> ( https://lkml.kernel.org/r/CAHk-=whWreGjEQ6yasspzBrNnS7EQiL+SknToWt=SzUh4XomyQ@mail.gmail.com ).

You can *float* these warning patches in -next to help with conversion if
necessary but you really have to convert most of the obvious existing users
beforehand.

> Step 2: Create a WQ for your module from __init function. The same flags
>         used by corresponding kernel-global WQ can be used when creating
>         the WQ for your module.
> 
>     my_wq = alloc_workqueue("my_wq_name", 0, 0);

And, the first preference would be converting to use flush_work() unless
defining a separate flush domain to flush multiple work items is absolutely
necessary.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ