Commit 3f08a302 authored by Mike Rapoport's avatar Mike Rapoport Committed by Linus Torvalds
Browse files

mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP option



CONFIG_HAVE_MEMBLOCK_NODE_MAP is used to differentiate initialization of
nodes and zones structures between the systems that have region to node
mapping in memblock and those that don't.

Currently all the NUMA architectures enable this option and for the
non-NUMA systems we can presume that all the memory belongs to node 0 and
therefore the compile time configuration option is not required.

The remaining few architectures that use DISCONTIGMEM without NUMA are
easily updated to use memblock_add_node() instead of memblock_add() and
thus have proper correspondence of memblock regions to NUMA nodes.

Still, free_area_init_node() must have a backward compatible version
because its semantics with and without CONFIG_HAVE_MEMBLOCK_NODE_MAP is
different.  Once all the architectures will use the new semantics, the
entire compatibility layer can be dropped.

To avoid addition of extra run time memory to store node id for
architectures that keep memblock but have only a single node, the node id
field of the memblock_region is guarded by CONFIG_NEED_MULTIPLE_NODES and
the corresponding accessors presume that in those cases it is always 0.

Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Tested-by: Hoan Tran <hoan@os.amperecomputing.com>	[arm64]
Acked-by: Catalin Marinas <catalin.marinas@arm.com>	[arm64]
Cc: Baoquan He <bhe@redhat.com>
Cc: Brian Cain <bcain@codeaurora.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Greg Ungerer <gerg@linux-m68k.org>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Guo Ren <guoren@kernel.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Nick Hu <nickhu@andestech.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Rich Felker <dalias@libc.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Link: http://lkml.kernel.org/r/20200412194859.12663-4-rppt@kernel.org


Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6f24fbd3
Loading
Loading
Loading
Loading
+0 −34
Original line number Diff line number Diff line
#
# Feature name:          numa-memblock
#         Kconfig:       HAVE_MEMBLOCK_NODE_MAP
#         description:   arch supports NUMA aware memblocks
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: |  ..  |
    |         arm: |  ..  |
    |       arm64: |  ok  |
    |         c6x: |  ..  |
    |        csky: |  ..  |
    |       h8300: |  ..  |
    |     hexagon: |  ..  |
    |        ia64: |  ok  |
    |        m68k: |  ..  |
    |  microblaze: |  ok  |
    |        mips: |  ok  |
    |       nds32: | TODO |
    |       nios2: |  ..  |
    |    openrisc: |  ..  |
    |      parisc: |  ..  |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: |  ok  |
    |       sparc: |  ok  |
    |          um: |  ..  |
    |   unicore32: |  ..  |
    |         x86: |  ok  |
    |      xtensa: |  ..  |
    -----------------------
+2 −2
Original line number Diff line number Diff line
@@ -144,8 +144,8 @@ setup_memory_node(int nid, void *kernel_end)
	if (!nid && (node_max_pfn < end_kernel_pfn || node_min_pfn > start_kernel_pfn))
		panic("kernel loaded out of ram");

	memblock_add(PFN_PHYS(node_min_pfn),
		     (node_max_pfn - node_min_pfn) << PAGE_SHIFT);
	memblock_add_node(PFN_PHYS(node_min_pfn),
			  (node_max_pfn - node_min_pfn) << PAGE_SHIFT, nid);

	/* Zone start phys-addr must be 2^(MAX_ORDER-1) aligned.
	   Note that we round this down, not up - node memory
+0 −1
Original line number Diff line number Diff line
@@ -162,7 +162,6 @@ config ARM64
	select HAVE_GCC_PLUGINS
	select HAVE_HW_BREAKPOINT if PERF_EVENTS
	select HAVE_IRQ_TIME_ACCOUNTING
	select HAVE_MEMBLOCK_NODE_MAP if NUMA
	select HAVE_NMI
	select HAVE_PATA_PLATFORM
	select HAVE_PERF_EVENTS
+0 −1
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ config IA64
	select HAVE_FUNCTION_TRACER
	select TTY
	select HAVE_ARCH_TRACEHOOK
	select HAVE_MEMBLOCK_NODE_MAP
	select HAVE_VIRT_CPU_ACCOUNTING
	select DMA_NONCOHERENT_MMAP
	select ARCH_HAS_SYNC_DMA_FOR_CPU
+2 −2
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@ void __init paging_init(void)

	min_addr = m68k_memory[0].addr;
	max_addr = min_addr + m68k_memory[0].size;
	memblock_add(m68k_memory[0].addr, m68k_memory[0].size);
	memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0);
	for (i = 1; i < m68k_num_memory;) {
		if (m68k_memory[i].addr < min_addr) {
			printk("Ignoring memory chunk at 0x%lx:0x%lx before the first chunk\n",
@@ -397,7 +397,7 @@ void __init paging_init(void)
				(m68k_num_memory - i) * sizeof(struct m68k_mem_info));
			continue;
		}
		memblock_add(m68k_memory[i].addr, m68k_memory[i].size);
		memblock_add_node(m68k_memory[i].addr, m68k_memory[i].size, i);
		addr = m68k_memory[i].addr + m68k_memory[i].size;
		if (addr > max_addr)
			max_addr = addr;
Loading