Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6931343pxb; Wed, 17 Feb 2021 18:30:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOn30IKHQyYtmSLefGgGrfFDHXGzXrBGGV5S527OfOA1EMtQOl0tV2zgV4HvLOUmcUP+iQ X-Received: by 2002:a05:6402:541:: with SMTP id i1mr1787586edx.36.1613615451648; Wed, 17 Feb 2021 18:30:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613615451; cv=none; d=google.com; s=arc-20160816; b=ffNgQjDvo0lvngqFki/wILAnG5GTYhAsTQn8YXOaxu0HNtEA0Q6ODd3z6N5KMnIY20 BVLb6QR/9uzB3ecFmM8gfe5NGFyVcjWoCpq+klzyPLgE0PUgrx22jY2k4gWoE8JoCe3E z4q4QKg6RfFlQZnhSVF/7L6b5F2tZnJ2qZAQJXqxLMaSsb54DEWxCiQ18+p+lkBiu87t 4+KtVFATpm6g6r+tqjgLAXocwImAksEtEIIq5p+y0Qca9Uoc44HeCMVtD5FxpW9KA3Lj 3P9Fwrwdau+chpoxIaSioHxqQvQDpsGg/w2/DlT58nMe5CJQ6tKwl2G5l8NYwEWAWOL9 DYhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=xcLDCrsSw8+hGGzCRTcNO5LhzG3HVAuAweQ0Ja2XfVo=; b=xhENf5biYA3jKzp+WX1Kbh3QVt4nFzRQlKHxaR6c12+ye4Xw4yEZGNJVPmXyoghuYu hnkK/APZiAkd/gwZ+eFAKCZxmAhtf838taf41L+tGSfRvYJJK0MetsCf48ZMc0N5G+IL YViYvEVjKcnp3lefgqP3od+8D/2y6k97WPjz6J9BmvUbUKLOhasREdPaz9BVX2rXscOd fhaFj/w9WKGsBsnJJM2rFR3cumZzyBBC21t4069CrqJt22OmWxw9ACBbsyEb77vxXcNg +Wfpwa9zPB0ttxBnFfZ+AnTmiLTdvYDXBaH4Hen7ApAK2zya40TrhfdzP2xDnS+VXJhW 8anw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w4si2492713ejz.337.2021.02.17.18.30.27; Wed, 17 Feb 2021 18:30:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229996AbhBRC1w (ORCPT + 99 others); Wed, 17 Feb 2021 21:27:52 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:12551 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229720AbhBRC1v (ORCPT ); Wed, 17 Feb 2021 21:27:51 -0500 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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! :)