Messages in this thread | | | Date | Wed, 29 Aug 2012 11:34:47 -0700 | From | Tejun Heo <> | Subject | Re: [PATCH 7/9 V3] workqueue: explicit way to wait for idles workers to finish |
| |
Hello,
On Thu, Aug 30, 2012 at 12:51:58AM +0800, Lai Jiangshan wrote: > busy_worker_rebind_fn() can't return until all idle workers are rebound. > This order is ensured by rebind_workers() currently. > > We use mutex_lock(&worker->pool->manager_mutex) to wait for all idle workers > to be rebound. this is an explicit way and it will ease the pain of > the rebind_workers(). > > The sleeping mutex_lock(&worker->pool->manager_mutex) must be put in the top of > busy_worker_rebind_fn(), because this busy worker thread can sleep > before the WORKER_REBIND is cleared, but can't sleep after > the WORKER_REBIND cleared.
I really can't say I like this overloading of manager_mutex. CPU up/down are actually behaving like the manager while it's holding the manager_mutex at least. I don't really think this non-manager-role-manager-mutex usage is worthwhile whatever simplification it makes to rebind path. Rebind path being a bit ugly / complex is better than it muddling non-cpu-hotplug path further.
Thanks.
-- tejun
| |