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: 13220954 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 521A2C77B78 for ; Sat, 22 Apr 2023 10:15:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C167D6B0075; Sat, 22 Apr 2023 06:15:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B514F6B0078; Sat, 22 Apr 2023 06:15:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9A3A66B007B; Sat, 22 Apr 2023 06:15:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 873B36B0075 for ; Sat, 22 Apr 2023 06:15:37 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 4697B14015E for ; Sat, 22 Apr 2023 10:15:37 +0000 (UTC) X-FDA: 80708620314.15.711842E Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by imf20.hostedemail.com (Postfix) with ESMTP id 362551C000C for ; Sat, 22 Apr 2023 10:15:34 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf20.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.99 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=1682158535; 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=mijX5G9vkIVUU+zycbfVU49M9mUY+uZK3RiHQt+rXiM=; b=0x46dowxkU16LJBBAu6ypXzGkSmWIY2dgX+IT6NuI4rIxdmqZABbSjS8YqC/e7Z4CDrwN4 CS2DTN6QWXfp1InC/6JyS2yLtzOkGr+ALhPKsigAPeJ1ogyS4AF5K//zqUZAwWYc5bNz6L wQPhYRuv9KCUXTWDoAi7gGAsZwWNXKo= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf20.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.99 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1682158535; a=rsa-sha256; cv=none; b=L2IF6y+pVK70b6VEYC6y5/1cFNZ0ovlKfzCA0wwaHyrMnJgJNrFGhsFzAXs1775MhvjaQA FSkeCzyZSPAGq9ZBrJyEPckO5slRDVqPOelvJwPc2ykELoS8gQKTkJiCQZsB9RQ7+f0a8b CdWAN57OGyd+ZZZixfO9F/Ng7A5PiN8= 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-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 362551C000C X-Stat-Signature: goqing93gydu1iuinsxt1keog5b1r9cp X-HE-Tag: 1682158534-154620 X-HE-Meta: U2FsdGVkX1/CV4DZ3kF4g5DbfJ6Vz/cblMNKKnGpAgfctaqT5t3MO03mxRNi/PXDwwee2JgeW0mkvw98omRdjgmnYWDKjIsDLb4a7tElGFD1Bixo3+NgfQSE4jqct5f5vxJKCyEMx2cp93PsZg+gBYQHHahJxXuV4HK69RQbZ2nE3V1Gfpmh2lRobGptqwDFWCupDX7Z8ILtRJMWnUCwSb2Na4Pg467UmrVZxyOjpz6Rk7kfDHJ8usXOdmTHTCQS8BTL6zr54Z5hCZYx6k7SitFgCvrcRCh7geC2o8rnGUbYDpOVVQK7QMMdrUaBYY9yfG2ooLKyTiA1oN68aZRk16k/GD1Kg8leI2eMl06lTxvSPBuU2+f+hLs66m2KdXGT9GL3Hnjx2I8F7/oiqRDV+WF9p6LnaCPBQmG1KXbV4lDz2/LJNe9cvcpvLWB13E3+xoFMn2MjbveFL/W/lFiP3+cXp/+U9pbI+WCAvZ7+b09Qz4ahRatB8UIuSt5T8yKy9Nw2UEfQzZnJ+juPigyaZJAM6405TEKV8tg7dyxfMftgHyS+AJvUHrjNki53/88b9FFNAb62kW4GKJFlDmzOiz5ulyltHVmNkZWvnYqOGCmdR+L39W2lApihj2s2qb2VHEbfNMrPomaqDGEeERTomc76o3hdaXUevRCFoUQ0V605cE22BGv9U+OCinhIMW9ViEQzlCMzKNU4or33osv3uR3CozP071BYgTJgEZ45gmaWpvK259uWJ4hmOGhrJ9x4YCTZ1Eaco3XZ/lP4xGBfZw6LGNQnex4y5i7rFr1kAW1FRFVWRoDmC/ZgDJMOwk6ohumgrjicOk6BIORfnXV7g44deuoEnYC97Yv+8/adOZJZbL9CckpFbzF57G5xOaAQCJwTX80bqLRX8OQuX+K7GNn4YcR5wni659Snkfkou/jp6fTTsp+gPzXoUBpId3kNYP1ViSrddMSaA3H0FE+ O3BbPzoD +kQ9W2fIKkVYR2ShNOWgKDW6bJ3JpxhSfoDM8N0LbAwJKst9VujmVh5sJiiogr+wTwcyYi4qNfmPpUmA6RrT3JzWOguA67BqRp7o7foo7KmQopwSEGWcdBStPRZ9hQbm8uvXEYJ16UEoFhOQ7Bh3g3kZwTmT2Ej9qtF1rQZRs2jYmMxw= 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" --- 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);