[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130310124632.GF24522@htj.dyndns.org>
Date: Sun, 10 Mar 2013 05:46:32 -0700
From: Tejun Heo <tj@...nel.org>
To: Lai Jiangshan <laijs@...fujitsu.com>
Cc: linux-kernel@...r.kernel.org, axboe@...nel.dk, jmoyer@...hat.com,
zab@...hat.com
Subject: Re: [PATCH 14/31] workqueue: replace POOL_MANAGING_WORKERS flag with
worker_pool->manager_mutex
Hello, Lai.
On Sun, Mar 10, 2013 at 06:09:38PM +0800, Lai Jiangshan wrote:
> > - if (pool->flags & POOL_MANAGING_WORKERS)
> > + if (!mutex_trylock(&pool->manager_mutex))
> > return ret;
> >
> > - pool->flags |= POOL_MANAGING_WORKERS;
>
>
> if mutex_trylock(&pool->manager_mutex) fails, it does not mean
> the pool is managing workers. (although current code does).
> so I recommend to keep POOL_MANAGING_WORKERS.
So, that's the intention. It's gonna be used during pool destruction
and we want all the workers to think that the pool is being managed
and it's safe to proceed.
> I suggest that you reuse assoc_mutex for your purpose(later patches).
> (and rename assoc_mutex back to manager_mutex)
They are different. assoc_mutex makes the workers wait for the
managership, which shouldn't happen during pool destruction. We want
the workers to assume that the pool is managed which is what
manager_mutex achieves.
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists