[PATCH v6] Improve the performance of --num-threads -d 31

"Zhou, Wenjian/周文剑" zhouwj-fnst at cn.fujitsu.com
Thu Apr 14 19:38:32 PDT 2016


On 04/15/2016 10:39 AM, Minfei Huang wrote:
> On 04/14/16 at 01:42pm, Zhou Wenjian wrote:
>> @@ -10223,6 +10263,20 @@ calculate_cyclic_buffer_size(void) {
>>   	 *  free memory for safety.
>>   	 */
>>   	limit_size = get_free_memory_size() * 0.6;
>> +
>> +	/*
>> +	 * Recalculate the limit_size according to num_threads.
>> +	 * And reset num_threads if there is not enough memory.
>> +	 */
>> +	if (limit_size - maximum_size < THREAD_REGION * info->num_threads) {
>> +		MSG("There isn't enough memory for %d threads.\n", info->num_threads);
>> +
>> +		info->num_threads = MAX(0, limit_size - maximum_size) / THREAD_REGION;
>
> Hi, Zhou.
>
> Since both limit_size and maximum_size are unsigned long long,
> comparison is necessary for the if branch. Thus the micro MAX can be
> removed as well.
>

Oh, I made a stupid mistake.
Thanks for pointing it out.

-- 
Thanks
Zhou





More information about the kexec mailing list