From: "\"Zhou, Wenjian/周文剑\"" <zhouwj-fnst@cn.fujitsu.com>
To: Minfei Huang <mhuang@redhat.com>
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH v6] Improve the performance of --num-threads -d 31
Date: Fri, 15 Apr 2016 10:38:32 +0800 [thread overview]
Message-ID: <57105428.2090900@cn.fujitsu.com> (raw)
In-Reply-To: <20160415023957.GA26257@dhcp-128-25.nay.redhat.com>
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
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
prev parent reply other threads:[~2016-04-15 2:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 5:42 [PATCH v6] Improve the performance of --num-threads -d 31 Zhou Wenjian
2016-04-14 5:56 ` "Zhou, Wenjian/周文剑"
2016-04-14 9:57 ` Minfei Huang
2016-04-15 0:17 ` "Zhou, Wenjian/周文剑"
2016-04-15 2:09 ` Minfei Huang
2016-04-15 5:24 ` Atsushi Kumagai
2016-04-15 10:09 ` "Zhou, Wenjian/周文剑"
2016-04-15 2:39 ` Minfei Huang
2016-04-15 2:38 ` "Zhou, Wenjian/周文剑" [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57105428.2090900@cn.fujitsu.com \
--to=zhouwj-fnst@cn.fujitsu.com \
--cc=kexec@lists.infradead.org \
--cc=mhuang@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox