From patchwork Sat Apr 22 10:15:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 86575 Return-Path: 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 + 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 ); 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 ; 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 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: X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 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: 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?= 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 Reviewed-by: David Hildenbrand Reviewed-by: "Huang, Ying" --- 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);