[PATCH v6] Improve the performance of --num-threads -d 31
Minfei Huang
mhuang at redhat.com
Thu Apr 14 19:39:57 PDT 2016
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.
Thanks
Minfei
More information about the kexec
mailing list