[sheepdog] [PATCH v2 5/5] work: shrink the number of worker threads dynamically
morita.kazutaka at gmail.com
Thu Feb 28 13:09:34 CET 2013
At Thu, 28 Feb 2013 19:28:32 +0800,
Liu Yuan wrote:
> On 02/28/2013 06:46 PM, MORITA Kazutaka wrote:
> > + if (wi->nr_pending + wi->nr_running <= wi->nr_threads / 2)
> > + /* we cannot shrink work queue during protection period. */
> > + return wi->tm_end_of_protection <= get_msec_time();
> Why we need delay shrinking?
To avoid many calls of pthread_create. Without it, threads are
frequently created and deleted like short threads, and it leads poor
performance on my environment.
More information about the sheepdog