From patchwork Wed Apr 29 16:29:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 11517865 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CCE7E14B4 for ; Wed, 29 Apr 2020 16:29:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8F25E20B80 for ; Wed, 29 Apr 2020 16:29:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="bX4UmI7Y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F25E20B80 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AD7AA8E0005; Wed, 29 Apr 2020 12:29:55 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id AAF158E0001; Wed, 29 Apr 2020 12:29:55 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 99F3E8E0005; Wed, 29 Apr 2020 12:29:55 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0037.hostedemail.com [216.40.44.37]) by kanga.kvack.org (Postfix) with ESMTP id 814118E0001 for ; Wed, 29 Apr 2020 12:29:55 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3ACA4440E for ; Wed, 29 Apr 2020 16:29:55 +0000 (UTC) X-FDA: 76761429150.19.step98_73a1c9beeed51 X-Spam-Summary: 2,0,0,a10e46bd6180492e,d41d8cd98f00b204,rppt@kernel.org,,RULES_HIT:41:69:355:379:800:960:966:968:973:988:989:1260:1277:1312:1313:1314:1345:1359:1437:1516:1518:1519:1535:1544:1593:1594:1595:1596:1605:1711:1730:1747:1777:1792:2194:2196:2198:2199:2200:2201:2393:2553:2559:2562:2731:2895:3138:3139:3140:3141:3142:3622:3834:3865:3866:3867:3868:3870:3871:3872:3874:4118:4250:4321:4385:4419:4560:4605:5007:6119:6261:6653:6742:6743:7576:7903:7904:7974:8784:9545:9592:10004:10967:11026:11232:11473:11658:11914:12043:12114:12219:12262:12296:12297:12438:12517:12519:12555:12679:12740:12895:12986:13161:13229:13255:13439:13895:14093:14096:14097:14181:14394:14721:14819:21080:21325:21451:21627:21990:30034:30054:30070:30074:30090:30091,0,RBL:198.145.29.99:@kernel.org:.lbl8.mailshell.net-62.2.0.100 64.100.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: step98_73a1c9beeed51 X-Filterd-Recvd-Size: 7846 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Wed, 29 Apr 2020 16:29:54 +0000 (UTC) Received: from kernel.org (unknown [87.70.161.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4622D2073E; Wed, 29 Apr 2020 16:29:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588177793; bh=0WLAW3RaOJqIeviw62D+1sbYIwOWpLfyLvSFzBZ/1RI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bX4UmI7YY7MbsM77fB95EYPVrNNMyR/EBLX8BbChEAsts+ChnIZnmlY0s5J3v1ES0 21Fy8E5o4VRlcz1gU4A9jUkztNYslFtzPSQ8j0i0q67mtFD7Z5RqJBXEJMqoU2jMSR FjIyjtx7U4phJ9zZIH0PgtWqCfz1Qfs4hHO4D1HM= Date: Wed, 29 Apr 2020 19:29:17 +0300 From: Mike Rapoport To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Baoquan He , Brian Cain , Catalin Marinas , "David S. Miller" , Geert Uytterhoeven , Greentime Hu , Greg Ungerer , Guan Xuetao , Guo Ren , Heiko Carstens , Helge Deller , Hoan Tran , "James E.J. Bottomley" , Jonathan Corbet , Ley Foon Tan , Mark Salter , Matt Turner , Max Filippov , Michael Ellerman , Michal Hocko , Michal Simek , Nick Hu , Paul Walmsley , Qian Cai , Richard Weinberger , Rich Felker , Russell King , Stafford Horne , Thomas Bogendoerfer , Tony Luck , Vineet Gupta , x86@kernel.org, Yoshinori Sato , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, Mike Rapoport Subject: [PATCH v2.5 16/20] mm: remove early_pfn_in_nid() and CONFIG_NODES_SPAN_OTHER_NODES Message-ID: <20200429162917.GL14260@kernel.org> References: <20200429121126.17989-1-rppt@kernel.org> <20200429121126.17989-17-rppt@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200429121126.17989-17-rppt@kernel.org> 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: On Wed, Apr 29, 2020 at 03:11:22PM +0300, Mike Rapoport wrote: > From: Mike Rapoport > > The commit f47ac088c406 ("mm: memmap_init: iterate over memblock regions > rather that check each PFN") made early_pfn_in_nid() obsolete and since > CONFIG_NODES_SPAN_OTHER_NODES is only used to pick a stub or a real > implementation of early_pfn_in_nid() it is also not needed anymore. > > Remove both early_pfn_in_nid() and the CONFIG_NODES_SPAN_OTHER_NODES. > > Co-developed-by: Hoan Tran > Signed-off-by: Hoan Tran > Signed-off-by: Mike Rapoport > --- Here's the version with the updated changelog: From 7415d1a9b7000c6eecd9f63770592e4d4a8d2463 Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Sat, 11 Apr 2020 11:26:49 +0300 Subject: [PATCH v2.5] mm: remove early_pfn_in_nid() and CONFIG_NODES_SPAN_OTHER_NODES The memmap_init() function was made to iterate over memblock regions and as the result the early_pfn_in_nid() function became obsolete. Since CONFIG_NODES_SPAN_OTHER_NODES is only used to pick a stub or a real implementation of early_pfn_in_nid(), it is also not needed anymore. Remove both early_pfn_in_nid() and the CONFIG_NODES_SPAN_OTHER_NODES. Co-developed-by: Hoan Tran Signed-off-by: Hoan Tran Signed-off-by: Mike Rapoport --- arch/powerpc/Kconfig | 9 --------- arch/sparc/Kconfig | 9 --------- arch/x86/Kconfig | 9 --------- mm/page_alloc.c | 20 -------------------- 4 files changed, 47 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 5f86b22b7d2c..74f316deeae1 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -685,15 +685,6 @@ config ARCH_MEMORY_PROBE def_bool y depends on MEMORY_HOTPLUG -# Some NUMA nodes have memory ranges that span -# other nodes. Even though a pfn is valid and -# between a node's start and end pfns, it may not -# reside on that node. See memmap_init_zone() -# for details. -config NODES_SPAN_OTHER_NODES - def_bool y - depends on NEED_MULTIPLE_NODES - config STDBINUTILS bool "Using standard binutils settings" depends on 44x diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 795206b7b552..0e4f3891b904 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -286,15 +286,6 @@ config NODES_SHIFT Specify the maximum number of NUMA Nodes available on the target system. Increases memory reserved to accommodate various tables. -# Some NUMA nodes have memory ranges that span -# other nodes. Even though a pfn is valid and -# between a node's start and end pfns, it may not -# reside on that node. See memmap_init_zone() -# for details. -config NODES_SPAN_OTHER_NODES - def_bool y - depends on NEED_MULTIPLE_NODES - config ARCH_SPARSEMEM_ENABLE def_bool y if SPARC64 select SPARSEMEM_VMEMMAP_ENABLE diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index f8bf218a169c..1ec2a5e2fef6 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1581,15 +1581,6 @@ config X86_64_ACPI_NUMA ---help--- Enable ACPI SRAT based node topology detection. -# Some NUMA nodes have memory ranges that span -# other nodes. Even though a pfn is valid and -# between a node's start and end pfns, it may not -# reside on that node. See memmap_init_zone() -# for details. -config NODES_SPAN_OTHER_NODES - def_bool y - depends on X86_64_ACPI_NUMA - config NUMA_EMU bool "NUMA emulation" depends on NUMA diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 8d112defaead..d35ca0996a09 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1541,26 +1541,6 @@ int __meminit early_pfn_to_nid(unsigned long pfn) } #endif /* CONFIG_NEED_MULTIPLE_NODES */ -#ifdef CONFIG_NODES_SPAN_OTHER_NODES -/* Only safe to use early in boot when initialisation is single-threaded */ -static inline bool __meminit early_pfn_in_nid(unsigned long pfn, int node) -{ - int nid; - - nid = __early_pfn_to_nid(pfn, &early_pfnnid_cache); - if (nid >= 0 && nid != node) - return false; - return true; -} - -#else -static inline bool __meminit early_pfn_in_nid(unsigned long pfn, int node) -{ - return true; -} -#endif - - void __init memblock_free_pages(struct page *page, unsigned long pfn, unsigned int order) {