[sheepdog] [PATCH v2 05/10] work: try to create worker threads in worker_thread_request_done

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue May 14 07:14:29 CEST 2013


At Tue, 14 May 2013 12:50:35 +0800,
Liu Yuan wrote:
> 
> On 05/14/2013 11:33 AM, MORITA Kazutaka wrote:
> > At Tue, 14 May 2013 11:18:12 +0800,
> > Liu Yuan wrote:
> >>
> >> On 05/13/2013 11:11 PM, MORITA Kazutaka wrote:
> >>> Currently, even if the number of nodes is increased, the dynamic work
> >>> queue doesn't create worker threads until new work is added to the
> >>> queue.  This tries to create threads just after the work queue detect
> >>> that the cluster is expanded.
> >>
> >> Why expanding at queue_work() isn't enough? Nodes are rarely added, so
> >> most of the time, expanding at queue_work() works fine. It looks much
> >> cleaner if we can reduce expanding call to one.
> > 
> > The reason I added this patch is that 'collie vdi check' calls all the
> > queue_work() before setting nr_nodes in work_queue_request_done(), so
> > there is no chance to extend the number of worker threads.  Maybe,
> > initializing nr_nodes in init_work_queue() is much better than this
> > patch.
> > 
> 
> Let collie take care of this looks better to me. Well, sd_nodes_nr is
> initialized at very early stage, why get_nr_nodes() don't set nr_nodes
> before calling queue_work()?

The v3 series calls get_nr_nodes() in init_work_queue().  What this
does is actually setting nr_nodes before calling queue_work() as you
say.  Is this not good enough?  Setting the number of nodes when
initializing work queue looks straightforward to me.

Thanks,

Kazutaka



More information about the sheepdog mailing list