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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 7B5F0C433E0 for ; Thu, 18 Feb 2021 02:27:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DBFE564D9F for ; Thu, 18 Feb 2021 02:27:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBFE564D9F Authentication-Results: mail.kernel.org; dmarc=none (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 3C2A46B006E; Wed, 17 Feb 2021 21:27:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 371446B0070; Wed, 17 Feb 2021 21:27:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2AF586B0071; Wed, 17 Feb 2021 21:27:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id 18E7C6B006E for ; Wed, 17 Feb 2021 21:27:14 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id CB0DE364D for ; Thu, 18 Feb 2021 02:27:13 +0000 (UTC) X-FDA: 77829801546.15.pan29_2615fc127651 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id A175C1814B0C1 for ; Thu, 18 Feb 2021 02:27:13 +0000 (UTC) X-HE-Tag: pan29_2615fc127651 X-Filterd-Recvd-Size: 2221 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Thu, 18 Feb 2021 02:27:12 +0000 (UTC) Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Dgz7t493bzMZP5; Thu, 18 Feb 2021 10:25:14 +0800 (CST) Received: from [10.174.179.144] (10.174.179.144) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Thu, 18 Feb 2021 10:27:06 +0800 Subject: Re: [PATCH] mm/hugetlb: remove redundant reservation check condition in alloc_huge_page() To: Mike Kravetz CC: , , Andrew Morton References: <20210210075443.26238-1-linmiaohe@huawei.com> <32f628d5-fa0c-2a81-2de4-d0a76d1c3e45@oracle.com> From: Miaohe Lin Message-ID: <9cd0da77-65c3-5ba2-f882-b54a1950bf39@huawei.com> Date: Thu, 18 Feb 2021 10:27:07 +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: <32f628d5-fa0c-2a81-2de4-d0a76d1c3e45@oracle.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.144] X-CFilter-Loop: Reflected X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi: On 2021/2/13 9:15, Mike Kravetz wrote: > On 2/9/21 11:54 PM, Miaohe Lin wrote: >> If there is no reservation corresponding to a vma, map_chg is always != 0, >> i.e. we can not meet the condition where a vma does not have reservation >> while map_chg = 0. > > This commit message might be easier to understand? > > vma_resv_map(vma) checks if a reserve map is associated with the vma. The > routine vma_needs_reservation() will check vma_resv_map(vma) and return 1 > if no reserv map is present. map_chg is set to the return value of > vma_needs_reservation(). Therefore, !vma_resv_map(vma) is redundant in the > expression: > map_chg || avoid_reserve || !vma_resv_map(vma); > Remove the redundant check. > Sorry for late respond! I will use this wonderful commit message. Many thanks! :)