From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6B08134AB for ; Sat, 3 Aug 2024 18:42:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722710531; cv=none; b=NiDYWgWKCJO9RpFDjWSUmCQviCCf/XK2PuoTyA5U/1+yKeeGHRvpy66M75ytWq+FQBtEc6av00Rb1LG2PRXspkWIH5cKZjaCQTkn3+u2at5ZpDRsUNVLpdJ49AEJcPFPAhYcoABvFsLYe173nzzAU1IwvWOF2mOKAfZ/L6X4n8w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722710531; c=relaxed/simple; bh=Xjsi+Ca9CvsJGyu2Y1MbcF2meTa1aM7i0ZPQmMhR+UU=; h=Date:To:From:Subject:Message-Id; b=FygI2HGbVtGdwmMoLsP/M11dG1ZHz4vU7cAkactpWfj2XV+a1ukfm8MOJW/fhysuS3IdMBrkrSYVomITyyYpM1Q8K89u55lmcoMBhOaXN7VyilBTnfoiV18oxMmxK2jI2pm5iO2xvsr7oE1WJsNkDqD0dL7pZVX6zoryWT9juJk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=jA/WD1V3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="jA/WD1V3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C47AC116B1; Sat, 3 Aug 2024 18:42:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1722710531; bh=Xjsi+Ca9CvsJGyu2Y1MbcF2meTa1aM7i0ZPQmMhR+UU=; h=Date:To:From:Subject:From; b=jA/WD1V3PHTdnL/XrWcu0mnyokCGI/gNoqaJRe0Lw6yNy5bV05E/6oPLLDeAiBAzH 5roXsScZK/ldihogR49NK99kUDPaZCcHNF3qdFqkF3NxhB80/B1TveyIE90VzzDUpU KLCSK32S38MqjQAgK1HovEEoVimGIA0KzZPj7ycE= Date: Sat, 03 Aug 2024 11:42:10 -0700 To: mm-commits@vger.kernel.org,ziy@nvidia.com,will@kernel.org,tsbogend@alpha.franken.de,tglx@linutronix.de,samuel.holland@sifive.com,robh@kernel.org,rafael@kernel.org,palmer@dabbelt.com,mpe@ellerman.id.au,mingo@redhat.com,Jonathan.Cameron@huawei.com,jiaxun.yang@flygoat.com,hca@linux.ibm.com,gregkh@linuxfoundation.org,gor@linux.ibm.com,glaubitz@physik.fu-berlin.de,david@redhat.com,dave@stgolabs.net,davem@davemloft.net,dave.hansen@linux.intel.com,dan.j.williams@intel.com,corbet@lwn.net,christophe.leroy@csgroup.eu,chenhuacai@kernel.org,catalin.marinas@arm.com,bp@alien8.de,arnd@arndb.de,andreas@gaisler.com,agordeev@linux.ibm.com,rppt@kernel.org,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-drop-config_have_arch_nodedata_extension.patch added to mm-unstable branch Message-Id: <20240803184211.1C47AC116B1@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: mm: drop CONFIG_HAVE_ARCH_NODEDATA_EXTENSION has been added to the -mm mm-unstable branch. Its filename is mm-drop-config_have_arch_nodedata_extension.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-drop-config_have_arch_nodedata_extension.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: "Mike Rapoport (Microsoft)" Subject: mm: drop CONFIG_HAVE_ARCH_NODEDATA_EXTENSION Date: Thu, 1 Aug 2024 09:08:07 +0300 There are no users of HAVE_ARCH_NODEDATA_EXTENSION left, so arch_alloc_nodedata() and arch_refresh_nodedata() are not needed anymore. Replace the call to arch_alloc_nodedata() in free_area_init() with memblock_alloc(), remove arch_refresh_nodedata() and cleanup include/linux/memory_hotplug.h from the associated ifdefery. Link: https://lkml.kernel.org/r/20240801060826.559858-8-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Tested-by: Zi Yan [x86_64 and arm64] Tested-by: Jonathan Cameron [arm64 + CXL via QEMU] Cc: Alexander Gordeev Cc: Andreas Larsson Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christophe Leroy Cc: Dan Williams Cc: Dave Hansen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: David S. Miller Cc: Greg Kroah-Hartman Cc: Heiko Carstens Cc: Huacai Chen Cc: Ingo Molnar Cc: Jiaxun Yang Cc: John Paul Adrian Glaubitz Cc: Jonathan Corbet Cc: Michael Ellerman Cc: Palmer Dabbelt Cc: Rafael J. Wysocki Cc: Rob Herring (Arm) Cc: Samuel Holland Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Will Deacon Signed-off-by: Andrew Morton --- include/linux/memory_hotplug.h | 48 ------------------------------- mm/mm_init.c | 3 - 2 files changed, 1 insertion(+), 50 deletions(-) --- a/include/linux/memory_hotplug.h~mm-drop-config_have_arch_nodedata_extension +++ a/include/linux/memory_hotplug.h @@ -16,54 +16,6 @@ struct resource; struct vmem_altmap; struct dev_pagemap; -#ifdef CONFIG_HAVE_ARCH_NODEDATA_EXTENSION -/* - * For supporting node-hotadd, we have to allocate a new pgdat. - * - * If an arch has generic style NODE_DATA(), - * node_data[nid] = kzalloc() works well. But it depends on the architecture. - * - * In general, generic_alloc_nodedata() is used. - * - */ -extern pg_data_t *arch_alloc_nodedata(int nid); -extern void arch_refresh_nodedata(int nid, pg_data_t *pgdat); - -#else /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */ - -#define arch_alloc_nodedata(nid) generic_alloc_nodedata(nid) - -#ifdef CONFIG_NUMA -/* - * XXX: node aware allocation can't work well to get new node's memory at this time. - * Because, pgdat for the new node is not allocated/initialized yet itself. - * To use new node's memory, more consideration will be necessary. - */ -#define generic_alloc_nodedata(nid) \ -({ \ - memblock_alloc(sizeof(*pgdat), SMP_CACHE_BYTES); \ -}) - -extern pg_data_t *node_data[]; -static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat) -{ - node_data[nid] = pgdat; -} - -#else /* !CONFIG_NUMA */ - -/* never called */ -static inline pg_data_t *generic_alloc_nodedata(int nid) -{ - BUG(); - return NULL; -} -static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat) -{ -} -#endif /* CONFIG_NUMA */ -#endif /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */ - #ifdef CONFIG_MEMORY_HOTPLUG struct page *pfn_to_online_page(unsigned long pfn); --- a/mm/mm_init.c~mm-drop-config_have_arch_nodedata_extension +++ a/mm/mm_init.c @@ -1838,11 +1838,10 @@ void __init free_area_init(unsigned long if (!node_online(nid)) { /* Allocator not initialized yet */ - pgdat = arch_alloc_nodedata(nid); + pgdat = memblock_alloc(sizeof(*pgdat), SMP_CACHE_BYTES); if (!pgdat) panic("Cannot allocate %zuB for node %d.\n", sizeof(*pgdat), nid); - arch_refresh_nodedata(nid, pgdat); } pgdat = NODE_DATA(nid); _ Patches currently in -mm which might be from rppt@kernel.org are mm-move-kernel-numac-to-mm.patch mips-sgi-ip27-make-node_data-the-same-as-on-all-other-architectures.patch mips-sgi-ip27-ensure-node_possible_map-only-contains-valid-nodes.patch mips-sgi-ip27-drop-have_arch_nodedata_extension.patch mips-loongson64-rename-__node_data-to-node_data.patch mips-loongson64-drop-have_arch_nodedata_extension.patch mm-drop-config_have_arch_nodedata_extension.patch arch-mm-move-definition-of-node_data-to-generic-code.patch arch-mm-pull-out-allocation-of-node_data-to-generic-code.patch x86-numa-simplify-numa_distance-allocation.patch x86-numa-use-get_pfn_range_for_nid-to-verify-that-node-spans-memory.patch x86-numa-move-fake_node_-defines-to-numa_emu.patch x86-numa_emu-simplify-allocation-of-phys_dist.patch x86-numa_emu-split-__apicid_to_node-update-to-a-helper-function.patch x86-numa_emu-use-a-helper-function-to-get-max_dma32_pfn.patch x86-numa-numa_addremove_cpu-make-cpu-parameter-unsigned.patch mm-introduce-numa_memblks.patch mm-move-numa_distance-and-related-code-from-x86-to-numa_memblks.patch mm-introduce-numa_emulation.patch mm-numa_memblks-introduce-numa_memblks_init.patch mm-numa_memblks-make-several-functions-and-variables-static.patch mm-numa_memblks-use-memblock_startend_of_dram-when-sanitizing-meminfo.patch of-numa-return-einval-when-no-numa-node-id-is-found.patch arch_numa-switch-over-to-numa_memblks.patch mm-make-range-to-target_node-lookup-facility-a-part-of-numa_memblks.patch docs-move-numa=fake-description-to-kernel-parameterstxt.patch