Message ID | c2eee65ecd15779721af85c9ff109a35345b52d4.1682158312.git.baolin.wang@linux.alibaba.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1618205vqo; Sat, 22 Apr 2023 03:18:44 -0700 (PDT) X-Google-Smtp-Source: AKy350ZsxaE1qZgXC+p17cxQau3G48+75OOV5HjmFLqxmUtxpq1ay2rpW04PeMLDqC6HGHYkJhm0 X-Received: by 2002:a05:6a00:124c:b0:639:c88b:c3e0 with SMTP id u12-20020a056a00124c00b00639c88bc3e0mr10189055pfi.22.1682158723673; Sat, 22 Apr 2023 03:18:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682158723; cv=none; d=google.com; s=arc-20160816; b=qxCrzlxIQYWn0KUrYhE3x4+25QcYblIkrooONVXEQgDoHGzoLP/wGQxTwAksCVtsm9 Ifo87NMdEEjO2OaGywspox8E/MfIKvu0PAqJhQgJfSlEjhh7hRE6JjllKHIK6iv895ZN fhcrqMVC61L6r5qq82KWdH4ZaVikTxl0mEDxXCGGfrUks0x2mxpSKXppIv7EwUTHDFvg QOrnDCOftH7uuu7/fRHlGkTsmgn8qTiE34q681Fy90kcUg4y0P6i12Hj70ZdjWysH5uT 8vggxa+ydV7LQg50WrfvrqdUSQN0e0S8i7mRKRlnZXCGT4yzt622Z/SeOsUDfGj3zBLY hEpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=mijX5G9vkIVUU+zycbfVU49M9mUY+uZK3RiHQt+rXiM=; b=no3OyfEs2PTxbJOoaZ1T9/r1TVzvtfLj1daV0grsUx8Zy1IM1dTDshir4uIi4YnRH6 Sg9MpBJPoOq2ONUVrNuemN12lPjODHeQFRfPLURRhTsOjGy8XFsVoLbfhGJvs0Oubh7p zyqNxNNctiewBQUiemUHCVBRu5wKSrJ61oOm2Ul5X4ihQLb1V1Rv3WwZixSY1Y+6Qrzp 76Iz1enL7BcbMIwMZ2DDqKttVkCgRfoyOby51l7SOBEA8b7oZ2LLqj84yw8F+2YE6yFq jbIfsT40fcXVH//vMJnP8KDz5LzBfwgYuI8C0OkaqtC+M4PHBS4sChoiysfe+FBcwKM9 OwhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x13-20020aa79acd000000b0063b8a36cbedsi6663305pfp.148.2023.04.22.03.18.28; Sat, 22 Apr 2023 03:18:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229732AbjDVKQF (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Sat, 22 Apr 2023 06:16:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229957AbjDVKPl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 22 Apr 2023 06:15:41 -0400 Received: from out30-100.freemail.mail.aliyun.com (out30-100.freemail.mail.aliyun.com [115.124.30.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0409E26B5 for <linux-kernel@vger.kernel.org>; Sat, 22 Apr 2023 03:15:31 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0VgfnVJl_1682158527; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VgfnVJl_1682158527) by smtp.aliyun-inc.com; Sat, 22 Apr 2023 18:15:28 +0800 From: Baolin Wang <baolin.wang@linux.alibaba.com> To: akpm@linux-foundation.org Cc: ying.huang@intel.com, mgorman@techsingularity.net, vbabka@suse.cz, mhocko@suse.com, david@redhat.com, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] mm/page_alloc: drop the unnecessary pfn_valid() for start pfn Date: Sat, 22 Apr 2023 18:15:17 +0800 Message-Id: <c2eee65ecd15779721af85c9ff109a35345b52d4.1682158312.git.baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763871265812973908?= X-GMAIL-MSGID: =?utf-8?q?1763871265812973908?= |
Series |
[1/2] mm/page_alloc: drop the unnecessary pfn_valid() for start pfn
|
|
Commit Message
Baolin Wang
April 22, 2023, 10:15 a.m. UTC
We've already used pfn_to_online_page() for start pfn to make sure
it is online and valid, so the pfn_valid() for the start pfn is
unnecessary, drop it.
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
mm/page_alloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 22.04.23 12:15, Baolin Wang wrote: > We've already used pfn_to_online_page() for start pfn to make sure > it is online and valid, so the pfn_valid() for the start pfn is > unnecessary, drop it. > > Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com> > --- Reviewed-by: David Hildenbrand <david@redhat.com>
Baolin Wang <baolin.wang@linux.alibaba.com> writes: > We've already used pfn_to_online_page() for start pfn to make sure > it is online and valid, so the pfn_valid() for the start pfn is > unnecessary, drop it. > > Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com> Thanks! Reviewed-by: "Huang, Ying" <ying.huang@intel.com> > --- > mm/page_alloc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 9de2a18519a1..6457b64fe562 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -1512,7 +1512,7 @@ struct page *__pageblock_pfn_to_page(unsigned long start_pfn, > /* end_pfn is one past the range we are checking */ > end_pfn--; > > - if (!pfn_valid(start_pfn) || !pfn_valid(end_pfn)) > + if (!pfn_valid(end_pfn)) > return NULL; > > start_page = pfn_to_online_page(start_pfn);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 9de2a18519a1..6457b64fe562 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1512,7 +1512,7 @@ struct page *__pageblock_pfn_to_page(unsigned long start_pfn, /* end_pfn is one past the range we are checking */ end_pfn--; - if (!pfn_valid(start_pfn) || !pfn_valid(end_pfn)) + if (!pfn_valid(end_pfn)) return NULL; start_page = pfn_to_online_page(start_pfn);