From: Tejun Heo <tj@kernel.org>
To: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] workqueue: make manage_workers() and pool destruction exclusive
Date: Mon, 19 Mar 2018 08:27:46 -0700 [thread overview]
Message-ID: <20180319152746.GN2943022@devbig577.frc2.facebook.com> (raw)
In-Reply-To: <20180319073508.3100-1-jiangshanlai@gmail.com>
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
prev parent reply other threads:[~2018-03-19 15:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-19 7:35 [PATCH] workqueue: make manage_workers() and pool destruction exclusive Lai Jiangshan
2018-03-19 15:27 ` Tejun Heo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180319152746.GN2943022@devbig577.frc2.facebook.com \
--to=tj@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox