From: Miaohe Lin <linmiaohe@huawei.com>
To: Mike Kravetz <mike.kravetz@oracle.com>, <akpm@linux-foundation.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>
Subject: Re: [PATCH v2 5/5] mm/hugetlb: avoid calculating fault_mutex_hash in truncate_op case
Date: Tue, 16 Mar 2021 14:49:31 +0800 [thread overview]
Message-ID: <4b3e9ea6-69e3-493c-342e-92117f274e06@huawei.com> (raw)
In-Reply-To: <d87264fb-0005-4f8b-7551-a5439108e9e1@oracle.com>
On 2021/3/16 11:07, Mike Kravetz wrote:
> On 3/15/21 7:27 PM, Miaohe Lin wrote:
>> The fault_mutex hashing overhead can be avoided in truncate_op case
>> because page faults can not race with truncation in this routine. So
>> calculate hash for fault_mutex only in !truncate_op case to save some cpu
>> cycles.
>>
>> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
>> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
>> Cc: Mike Kravetz <mike.kravetz@oracle.com>
>> ---
>> v1->v2:
>> remove unnecessary initialization for variable hash
>> collect Reviewed-by tag from Mike Kravetz
>
> My apologies for not replying sooner and any misunderstanding from my
> previous comments.
>
That's all right.
> If the compiler is going to produce a warning because the variable is
> not initialized, then we will need to keep the initialization.
> Otherwise, this will show up as a build regression. Ideally, there
> would be a modifier which could be used to tell the compiler the
> variable will used. I do not know if such a modifier exists.
>
I do not know if such a modifier exists too. But maybe not all compilers are intelligent
enough to not produce a warning. It would be safe to keep the initialization...
> The patch can not produce a new warning. So, if you need to initialize
So just drop this version of the patch? Or should I send a new version with your Reviewed-by tag and
keep the initialization?
> the variable then do it. My Reviewed-by still applies.
>
next prev parent reply other threads:[~2021-03-16 6:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-16 2:27 [PATCH v2 5/5] mm/hugetlb: avoid calculating fault_mutex_hash in truncate_op case Miaohe Lin
2021-03-16 3:07 ` Mike Kravetz
2021-03-16 6:49 ` Miaohe Lin [this message]
2021-03-17 0:27 ` Mike Kravetz
2021-03-17 1:44 ` Miaohe Lin
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=4b3e9ea6-69e3-493c-342e-92117f274e06@huawei.com \
--to=linmiaohe@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.