From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF878C433DB for ; Wed, 17 Mar 2021 01:45:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1D8EB64F8F for ; Wed, 17 Mar 2021 01:45:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D8EB64F8F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 512E76B006E; Tue, 16 Mar 2021 21:44:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C21F6B0070; Tue, 16 Mar 2021 21:44:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 363256B0071; Tue, 16 Mar 2021 21:44:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0193.hostedemail.com [216.40.44.193]) by kanga.kvack.org (Postfix) with ESMTP id 19F5D6B006E for ; Tue, 16 Mar 2021 21:44:59 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D4FBA4DB7 for ; Wed, 17 Mar 2021 01:44:58 +0000 (UTC) X-FDA: 77927672676.22.7435FCB Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf12.hostedemail.com (Postfix) with ESMTP id E2A4DDC for ; Wed, 17 Mar 2021 01:44:57 +0000 (UTC) Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4F0Xx62L7SzkbBs; Wed, 17 Mar 2021 09:43:22 +0800 (CST) Received: from [10.174.177.131] (10.174.177.131) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.498.0; Wed, 17 Mar 2021 09:44:50 +0800 Subject: Re: [PATCH v2 5/5] mm/hugetlb: avoid calculating fault_mutex_hash in truncate_op case To: Mike Kravetz , CC: , References: <20210316022758.52993-1-linmiaohe@huawei.com> <4b3e9ea6-69e3-493c-342e-92117f274e06@huawei.com> <952e9130-a084-20a7-aa7c-486fe9ccc8c6@oracle.com> From: Miaohe Lin Message-ID: Date: Wed, 17 Mar 2021 09:44:50 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <952e9130-a084-20a7-aa7c-486fe9ccc8c6@oracle.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.131] X-CFilter-Loop: Reflected X-Stat-Signature: qzsuagontr8xq17kkthuajjhui6ht81x X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: E2A4DDC Received-SPF: none (huawei.com>: No applicable sender policy available) receiver=imf12; identity=mailfrom; envelope-from=""; helo=szxga06-in.huawei.com; client-ip=45.249.212.32 X-HE-DKIM-Result: none/none X-HE-Tag: 1615945497-510363 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2021/3/17 8:27, Mike Kravetz wrote: > On 3/15/21 11:49 PM, Miaohe Lin wrote: >> 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 >>>> Signed-off-by: Miaohe Lin >>>> Cc: Mike Kravetz >>>> --- >>>> 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? >> > > Yes, drop this version of the patch. You can add my Reviewed-by to the > previous version that included the initialization and resend. > Will do. Many thanks. :) > All the cleanup patches in this series should be good to go. >