From patchwork Mon Aug 15 11:10:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 12943440 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 9216BC00140 for ; Mon, 15 Aug 2022 11:04:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E19836B0073; Mon, 15 Aug 2022 07:04:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DA23F6B0074; Mon, 15 Aug 2022 07:04:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C42F86B0075; Mon, 15 Aug 2022 07:04:43 -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 B1C116B0073 for ; Mon, 15 Aug 2022 07:04:43 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 94638A05EE for ; Mon, 15 Aug 2022 11:04:43 +0000 (UTC) X-FDA: 79801544046.21.268638B Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf08.hostedemail.com (Postfix) with ESMTP id BFBDF1601D1 for ; Mon, 15 Aug 2022 11:04:42 +0000 (UTC) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4M5rsm1sb4zXdfs; Mon, 15 Aug 2022 19:00:28 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 15 Aug 2022 19:04:36 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 15 Aug 2022 19:04:36 +0800 From: Kefeng Wang To: Andrew Morton , CC: , Kefeng Wang Subject: [PATCH] mm: kill find_min_pfn_with_active_regions() Date: Mon, 15 Aug 2022 19:10:17 +0800 Message-ID: <20220815111017.39341-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf08.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660561483; a=rsa-sha256; cv=none; b=JYOr5eniIul1SDzoFv+r3jrIqTKL7I0NstHL03uY+dXfWrBlj6BV6GzJyP9VIsFBUandvN 4uLDkM8ip8zf6jRYGLPy2slwnCTz6XZ3nOaA8VDE6PQBmOkiNKaO6pcg+CsokASnBbZJ/u c+GNY8aNsHT2NjjsYy0ApfbjrgcwBxU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660561483; 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-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=KXCQ5AqI2aaCdZE2ClSq3FasSLyrWPKpTPzQa9+AblI=; b=IZ5WN1x7onIydXmmwUpGC03EOl3dhLXfean1K38S+Uxwq+zIwN1xviVYJTYdSaUwnskbM3 /1fnGuLfGVFQgzaQjLh/sJYIxzcUTzBgeCUY2MNcurWTHpJEC4SU9LJMstfjPwsyza2sTv Rev/nnIL+IkPJVj7xViZ4zP+uQhDdIY= X-Rspam-User: Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf08.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com X-Stat-Signature: mtetyrp8yknnwg4t5pmdj3jhmha4garf X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: BFBDF1601D1 X-HE-Tag: 1660561482-646820 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: The find_min_pfn_with_active_regions() is only called in free_area_init(), Move PHYS_PFN(memblock_start_of_DRAM()) into free_area_init(), and kill find_min_pfn_with_active_regions(). Signed-off-by: Kefeng Wang --- include/linux/mm.h | 1 - mm/page_alloc.c | 13 +------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 3bedc449c14d..59144ad0a54c 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2488,7 +2488,6 @@ extern unsigned long absent_pages_in_range(unsigned long start_pfn, unsigned long end_pfn); extern void get_pfn_range_for_nid(unsigned int nid, unsigned long *start_pfn, unsigned long *end_pfn); -extern unsigned long find_min_pfn_with_active_regions(void); #ifndef CONFIG_NUMA static inline int early_pfn_to_nid(unsigned long pfn) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e5486d47406e..34eda5c18fdb 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7908,17 +7908,6 @@ unsigned long __init node_map_pfn_alignment(void) return ~accl_mask + 1; } -/** - * find_min_pfn_with_active_regions - Find the minimum PFN registered - * - * Return: the minimum PFN based on information provided via - * memblock_set_node(). - */ -unsigned long __init find_min_pfn_with_active_regions(void) -{ - return PHYS_PFN(memblock_start_of_DRAM()); -} - /* * early_calculate_totalpages() * Sum pages in active regions for movable zone. @@ -8211,7 +8200,7 @@ void __init free_area_init(unsigned long *max_zone_pfn) memset(arch_zone_highest_possible_pfn, 0, sizeof(arch_zone_highest_possible_pfn)); - start_pfn = find_min_pfn_with_active_regions(); + start_pfn = PHYS_PFN(memblock_start_of_DRAM()); descending = arch_has_descending_max_zone_pfns(); for (i = 0; i < MAX_NR_ZONES; i++) {