From patchwork Sun Apr 23 10:59:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 13221283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79E6DC77B7C for ; Sun, 23 Apr 2023 10:59:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 68DF86B0074; Sun, 23 Apr 2023 06:59:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6650D6B0075; Sun, 23 Apr 2023 06:59:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 514F96B0078; Sun, 23 Apr 2023 06:59:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 25F2E6B0075 for ; Sun, 23 Apr 2023 06:59:49 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 049DE1A022D for ; Sun, 23 Apr 2023 10:59:49 +0000 (UTC) X-FDA: 80712360498.28.1825684 Received: from out30-112.freemail.mail.aliyun.com (out30-112.freemail.mail.aliyun.com [115.124.30.112]) by imf24.hostedemail.com (Postfix) with ESMTP id 0F70F18000D for ; Sun, 23 Apr 2023 10:59:46 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf24.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.112 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682247587; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=64GR5p2l4Z02IYdj0MM9eN1KhH4FGFdVF8hApvUlZkI=; b=B7BmxFWoxHwTCNYpVzpwnqim8uSPCX8dKyj476E3jZDQiLJlxiWAmnHWGGW+/8wcpkJ46T sgqlYaz47xFHgRrFEq//HFCVBwIjEuolMzPzsPaMfDZYu9l40Xq8zVNs8FDvtYEjACIVsG l8+x58xJU2VYhe/61TACkD99+IHKHZM= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf24.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.112 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1682247587; a=rsa-sha256; cv=none; b=M1cHfSLor6ui822K4vDAsn4wQsklSBItn7Y6Jffj1DGkWbfUURbtC2l+JMMKJRLd2h7yi2 0G8Fzter8VaW4PiaUaIxleIJUgb8OTp7+ttpBjbRzJX89mMiuikRpU16j1YDFPfVQtJBCk x3lkUKzpVltHV1Oso1Gx3U9uh2fwhLA= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0VgjkYeH_1682247579; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VgjkYeH_1682247579) by smtp.aliyun-inc.com; Sun, 23 Apr 2023 18:59:40 +0800 From: Baolin Wang To: akpm@linux-foundation.org Cc: rppt@kernel.org, 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 v2 1/2] mm/page_alloc: drop the unnecessary pfn_valid() for start pfn Date: Sun, 23 Apr 2023 18:59:10 +0800 Message-Id: <9fc85cce8908938f4fd75ff50bc981c073779aa5.1682229876.git.baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 0F70F18000D X-Rspam-User: X-Stat-Signature: ifn3sods3trrnw7z1m5kiq31ys8ok7yo X-HE-Tag: 1682247586-879295 X-HE-Meta: U2FsdGVkX1+buwgIO4YHrQBTX9NATFdg8oNbnaeZiowjUT2vXBFb1J/dgWzSVCAb2Um5SAlRkrTSNikZUkiA51Z950pVS64lAVJGASEiWaM3wlEcwLZlomJhhiJIEQ9LpjNEtfHpqGgmneQXuQhHp35Azgg3M/sKBhN5iN8FcDzyanboAPKYaoXrcdDEmpfW/XNtOMH/9rec1zbd5uGgWmxBugOJH2V0PrinTyLtHodu7crJClbgGGukxlti8LeBploReB1eJDwUXDrQRk9ZxAJmBiRAM5M0LIY0hjvur967kla3Dlj4Eg7auP1D2yL9F+/2pqzPSXkXogpfPpDcVi7NMl+ILanV7X1ehNHS34xsrnNlUFoZYzKAZ+2fNBLmcnOQgqtvF9ZHnRiwRxwQNJRgeOWfh3hEPTRW9/JS/h10uqYV4gMvbWySj61BlEcONYe7O5jdiR1+h2Hr2MwGFDiwUKYm+N6U0pcVC8jLSI9Yy4my5fr4A19CTS+vyxGRaPG/l9Q5Le6rHxijC/CFOCrKGkMCwH7qfi3bOR24s7mLFgX6GMhTpuzQGeBcaJ8Oa36HhIzBsG1LxbUCr8PqRGe+GehpwHsoxdutlISIatQHI6ojNN45hF5fCjdpLvpFygvEQznl8p1QPTByHhOE6HQL2bkPBD/EY8ui/dZXhMddnPI8tZAH5pB/Enq9E0lBHu6V5M0XSpoKsJ8WJm2LVx7ueQ+vz2+SqRS0Z8OXooBF3Fiej3y5LjQGyEYTrBInFmFpnIsqYU1Ipg/eJe2rPKSldTO6UfycomEzFbMLTzXvbKuIVEPXxdqKz6o2yDWFghfl9DybITBaLiJw39mV7FE8IzCVeoEgFi/j1+u1wTnvoGCc+Qd7bnOrdcD/0JvCJyfmyJUf53kuhXkHB0uLe6QKe3yUnJGtG3kFn5zEqJjscR5R4gd7VgCNos7leoWBRLkpH6qyliKsfAvDzz2 lgZ+HVpr wJKAkTUKE+Ylf47cf1hS0mC0T/yxNXcshJCrLEHxS3zURhBDbx0RJHaDuT0uKEFxzvz9eXvBSGyGOZV6b50gvnAsQv6Fg+Im2s3MEDch0yIQLm44MSk6DiV1GEvniNLxMvXQAg3zblESMxMbb4qerO5aFjdd4T2qn/NUWFwJXxrUy/xhu8SME/3wApBtTSHhH6a7qT77RKjkmuLJYr3eW2OHibg== 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: 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" Acked-by: Michal Hocko --- Changes from v1: - Collect reviewed tags. Thanks David and 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);