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:   Thu, 28 May 2020 16:35:56 +0800
From:   Lai Jiangshan <jiangshanlai@...il.com>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:     Lai Jiangshan <laijs@...ux.alibaba.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...nel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Tejun Heo <tj@...nel.org>
Subject: Re: [PATCH 1/2] workqueue: pin the pool while it is managing

On Thu, May 28, 2020 at 4:08 PM Sebastian Andrzej Siewior
<bigeasy@...utronix.de> wrote:
>
> On 2020-05-28 03:06:55 [+0000], Lai Jiangshan wrote:
> > So that put_unbound_pool() can ensure all workers in idle,
> > no unfinished manager. And it doens't need to wait any manager
> > and can go to delete all the idle workers straight away.
> >
> > Also removes manager waitqueue, because it is unneeded and as
> > Sebastian Andrzej Siewior said:
> >
> >   The workqueue code has it's internal spinlock (pool::lock) and also
> >   implicit spinlock usage in the wq_manager waitqueue. These spinlocks
> >   are converted to 'sleeping' spinlocks on a RT-kernel.
> >
> >   Workqueue functions can be invoked from contexts which are truly atomic
> >   even on a PREEMPT_RT enabled kernel. Taking sleeping locks from such
> >   contexts is forbidden.
> >
> >   pool::lock can be converted to a raw spinlock as the lock held times
> >   are short. But the workqueue manager waitqueue is handled inside of
> >   pool::lock held regions which again violates the lock nesting rules
> >   of raw and regular spinlocks.
>
> This seems to work for my test case I had test my chance. And lockdep
> didn't complain so…
>
> If you prefer this over my 1/2 what do we do about 2/2? Do you want me
> to repost it?

I think we can just wait until Tejun reviews them.

If there is something wrong that I missed in my patch, your patches
are the best choice.

If I need to update my patch, I will repost the 3 patches
(2 of mine, the 2/2 of yours). At least I forgot to add
"Reported-by Sebastian Andrzej Siewior <bigeasy@...utronix.de>"
in the patch.

If Tejun queues my patches right away, you can rebase the 2/2
of yours and repost it.

Lai

>
> Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ