lkml.org 
[lkml]   [2018]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2018-03-19 16:28    [W:0.027 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site