[sheepdog] [PATCH v2 5/5] work: shrink the number of worker threads dynamically
Liu Yuan
namei.unix at gmail.com
Thu Feb 28 13:17:23 CET 2013
On 02/28/2013 08:09 PM, MORITA Kazutaka wrote:
> 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.
>
Then we'd better embed this as comment. And what about longer delay,
which might further reduce the false shrinking?
Thanks,
Yuan
More information about the sheepdog
mailing list