[sheepdog] [PATCH v4 1/3] work: protect nr_threads by wi->workers_lock

Hitoshi Mitake mitake.hitoshi at gmail.com
Wed Dec 18 07:43:50 CET 2013


At Wed, 18 Dec 2013 14:39:19 +0800,
Liu Yuan wrote:
> 
> On Wed, Dec 18, 2013 at 03:04:21PM +0900, Hitoshi Mitake wrote:
> > Previous protection scheme of wi->nr_thread in work.c was
> > unclear because wi->startup_lock was also used for protecting it
> > during workqueue grow/shrink. This patch let work.c protect
> > wi->nr_thread by the new wi->workers_lock.
> 
> how about merge ->workers_lock and ->pending_lock into a single lock? It looks
> neater.

I don't agree with it. Merging the locks will enlarge the critical section and
it will harm performance (the problem current work queue mechanism
has).

Thanks,
Hitoshi




More information about the sheepdog mailing list