[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180319152746.GN2943022@devbig577.frc2.facebook.com>
Date: Mon, 19 Mar 2018 08:27:46 -0700
From: Tejun Heo <tj@...nel.org>
To: Lai Jiangshan <jiangshanlai@...il.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] workqueue: make manage_workers() and pool destruction
exclusive
On Mon, Mar 19, 2018 at 03:35:07PM +0800, Lai Jiangshan wrote:
> The original code allows destroying the pool when the pool
> is still active in manage_workers(). A synchronization
> mechanism between manage_workers() and pool destruction
> was added for protection.
>
> This patch simply makes manage_workers() and pool destruction
> exclusive by getting an indirect refcount of the pool in
> manage_workers(). "indirect" means it gets a refcount of
> the first involved pwq which holds a refcount of the pool.
> This refcount can prevent the pool from being destroyed.
>
> The original synchronization mechanism (wq_manager_wait)
> is also removed.
Hmm... idk, this is more indirect and subtle than the existing code
and it's not like the existing code was overly complicated.
Thanks.
--
tejun
Powered by blists - more mailing lists