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,URIBL_BLOCKED,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 93CAEC433E0 for ; Tue, 16 Mar 2021 06:49:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D9976650FA for ; Tue, 16 Mar 2021 06:49:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9976650FA 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 5F0C36B006C; Tue, 16 Mar 2021 02:49:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A1006B006E; Tue, 16 Mar 2021 02:49:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 48FAC6B0070; Tue, 16 Mar 2021 02:49:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0219.hostedemail.com [216.40.44.219]) by kanga.kvack.org (Postfix) with ESMTP id 363EA6B006C for ; Tue, 16 Mar 2021 02:49:39 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E555E180AD837 for ; Tue, 16 Mar 2021 06:49:38 +0000 (UTC) X-FDA: 77924811636.29.C3B1015 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf13.hostedemail.com (Postfix) with ESMTP id C99CAE0011E1 for ; Tue, 16 Mar 2021 06:49:37 +0000 (UTC) Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4F03kj2D50z17Ltv; Tue, 16 Mar 2021 14:47:41 +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; Tue, 16 Mar 2021 14:49:31 +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> From: Miaohe Lin Message-ID: <4b3e9ea6-69e3-493c-342e-92117f274e06@huawei.com> Date: Tue, 16 Mar 2021 14:49:31 +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: 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: ag14uqx17kup4owj59cm94k7o4qbfa8q X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: C99CAE0011E1 Received-SPF: none (huawei.com>: No applicable sender policy available) receiver=imf13; identity=mailfrom; envelope-from=""; helo=szxga04-in.huawei.com; client-ip=45.249.212.190 X-HE-DKIM-Result: none/none X-HE-Tag: 1615877377-476053 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/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? > the variable then do it. My Reviewed-by still applies. >