Remove DISCONTIGMEM memory model
Subsystems (23)
Mike Rapoport
maintainerv3 cover Remove DISCONTIGMEM memory model
From: Mike Rapoport <[email protected]>
Hi,
SPARSEMEM memory model was supposed to entirely replace DISCONTIGMEM a (long) while ago. The last architectures that used DISCONTIGMEM were updated to use other memory models in v5.11 and it is about the time to entirely remove DISCONTIGMEM from the kernel.
This set removes DISCONTIGMEM from alpha, arc and m68k, simplifies memory model selection in mm/Kconfig and replaces usage of redundant CONFIG_NEED_MULTIPLE_NODES and CONFIG_FLAT_NODE_MEM_MAP with CONFIG_NUMA and CONFIG_FLATMEM respectively.
I've also removed NUMA support on alpha that was BROKEN for more than 15 years.
There were also minor updates all over arch/ to remove mentions of DISCONTIGMEM in comments and #ifdefs.
v3:
* Remove stale reference of CONFIG_NEED_MULTIPLE_NODES and stale discontigmem comment, per Geert
* Add Vineet Acks
* Fix spelling in cover letter subject
v2: Link: https://lore.kernel.org/lkml/[email protected]
* Fix build errors reported by kbuild bot
* Add additional cleanups in m68k as suggested by Geert
v1: Link: https://lore.kernel.org/lkml/[email protected]
Mike Rapoport (9):
alpha: remove DISCONTIGMEM and NUMA
arc: update comment about HIGHMEM implementation
arc: remove support for DISCONTIGMEM
m68k: remove support for DISCONTIGMEM
mm: remove CONFIG_DISCONTIGMEM
arch, mm: remove stale mentions of DISCONIGMEM
docs: remove description of DISCONTIGMEM
mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA
mm: replace CONFIG_FLAT_NODE_MEM_MAP with CONFIG_FLATMEM
Documentation/admin-guide/sysctl/vm.rst | 12 +- Documentation/vm/memory-model.rst | 45 +---- arch/alpha/Kconfig | 22 --- arch/alpha/include/asm/machvec.h | 6 - arch/alpha/include/asm/mmzone.h | 100 ----------- arch/alpha/include/asm/pgtable.h | 4 - arch/alpha/include/asm/topology.h | 39 ----- arch/alpha/kernel/core_marvel.c | 53 +----- arch/alpha/kernel/core_wildfire.c | 29 +-- arch/alpha/kernel/pci_iommu.c | 29 --- arch/alpha/kernel/proto.h | 8 - arch/alpha/kernel/setup.c | 16 -- arch/alpha/kernel/sys_marvel.c | 5 - arch/alpha/kernel/sys_wildfire.c | 5 - arch/alpha/mm/Makefile | 2 - arch/alpha/mm/init.c | 3 - arch/alpha/mm/numa.c | 223 ------------------------ arch/arc/Kconfig | 13 -- arch/arc/include/asm/mmzone.h | 40 ----- arch/arc/mm/init.c | 21 +-- arch/arm64/Kconfig | 2 +- arch/ia64/Kconfig | 2 +- arch/ia64/kernel/topology.c | 5 +- arch/ia64/mm/numa.c | 5 +- arch/m68k/Kconfig.cpu | 10 -- arch/m68k/include/asm/mmzone.h | 10 -- arch/m68k/include/asm/page.h | 2 +- arch/m68k/include/asm/page_mm.h | 35 ---- arch/m68k/mm/init.c | 20 --- arch/mips/Kconfig | 2 +- arch/mips/include/asm/mmzone.h | 8 +- arch/mips/include/asm/page.h | 2 +- arch/mips/mm/init.c | 7 +- arch/nds32/include/asm/memory.h | 6 - arch/powerpc/Kconfig | 2 +- arch/powerpc/include/asm/mmzone.h | 4 +- arch/powerpc/kernel/setup_64.c | 2 +- arch/powerpc/kernel/smp.c | 2 +- arch/powerpc/kexec/core.c | 4 +- arch/powerpc/mm/Makefile | 2 +- arch/powerpc/mm/mem.c | 4 +- arch/riscv/Kconfig | 2 +- arch/s390/Kconfig | 2 +- arch/sh/include/asm/mmzone.h | 4 +- arch/sh/kernel/topology.c | 2 +- arch/sh/mm/Kconfig | 2 +- arch/sh/mm/init.c | 2 +- arch/sparc/Kconfig | 2 +- arch/sparc/include/asm/mmzone.h | 4 +- arch/sparc/kernel/smp_64.c | 2 +- arch/sparc/mm/init_64.c | 12 +- arch/x86/Kconfig | 2 +- arch/x86/kernel/setup_percpu.c | 6 +- arch/x86/mm/init_32.c | 4 +- arch/xtensa/include/asm/page.h | 4 - include/asm-generic/memory_model.h | 37 +--- include/asm-generic/topology.h | 2 +- include/linux/gfp.h | 4 +- include/linux/memblock.h | 6 +- include/linux/mm.h | 4 +- include/linux/mmzone.h | 20 ++- kernel/crash_core.c | 4 +- mm/Kconfig | 36 +--- mm/memblock.c | 8 +- mm/memory.c | 3 +- mm/page_alloc.c | 25 +-- mm/page_ext.c | 2 +- 67 files changed, 101 insertions(+), 911 deletions(-) delete mode 100644 arch/alpha/include/asm/mmzone.h delete mode 100644 arch/alpha/mm/numa.c delete mode 100644 arch/arc/include/asm/mmzone.h delete mode 100644 arch/m68k/include/asm/mmzone.h
base-commit: c4681547bcce777daf576925a966ffa824edd09d
Signature · 7 lines
2.28.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Mike Rapoport
maintainerPATCH v3 1/9 alpha: remove DISCONTIGMEM and NUMA
From: Mike Rapoport <[email protected]>
NUMA is marked broken on alpha for more than 15 years and DISCONTIGMEM was replaced with SPARSEMEM in v5.11.
Remove both NUMA and DISCONTIGMEM support from alpha.
--- arch/alpha/Kconfig | 22 --- arch/alpha/include/asm/machvec.h | 6 - arch/alpha/include/asm/mmzone.h | 100 -------------- arch/alpha/include/asm/pgtable.h | 4 - arch/alpha/include/asm/topology.h | 39 ------ arch/alpha/kernel/core_marvel.c | 53 +------ arch/alpha/kernel/core_wildfire.c | 29 +--- arch/alpha/kernel/pci_iommu.c | 29 ---- arch/alpha/kernel/proto.h | 8 -- arch/alpha/kernel/setup.c | 16 --- arch/alpha/kernel/sys_marvel.c | 5 - arch/alpha/kernel/sys_wildfire.c | 5 - arch/alpha/mm/Makefile | 2 - arch/alpha/mm/init.c | 3 - arch/alpha/mm/numa.c | 223 ------------------------------ 15 files changed, 4 insertions(+), 540 deletions(-) delete mode 100644 arch/alpha/include/asm/mmzone.h delete mode 100644 arch/alpha/mm/numa.c
arch/alpha/Kconfig +0 -22
@@ -549,29 +549,12 @@ config NR_CPUS MARVEL support can handle a maximum of 32 CPUs, all the others with working support have a maximum of 4 CPUs. -config ARCH_DISCONTIGMEM_ENABLE - bool "Discontiguous Memory Support" - depends on BROKEN - help - Say Y to support efficient handling of discontiguous physical memory, - for architectures which are either NUMA (Non-Uniform Memory Access) - or have huge holes in the physical address space for other reasons. - See <file:Documentation/vm/numa.rst> for more. - config ARCH_SPARSEMEM_ENABLE bool "Sparse Memory Support" help Say Y to support efficient handling of discontiguous physical memory, for systems that have huge holes in the physical address space. -config NUMA - bool "NUMA Support (EXPERIMENTAL)" - depends on DISCONTIGMEM && BROKEN - help - Say Y to compile the kernel to support NUMA (Non-Uniform Memory - Access). This option is for configuring high-end multiprocessor - server machines. If in doubt, say N. - config ALPHA_WTINT bool "Use WTINT" if ALPHA_SRM || ALPHA_GENERIC default y if ALPHA_QEMU
@@ -596,11 +579,6 @@ config ALPHA_WTINT If unsure, say N. -config NODES_SHIFT - int - default "7" - depends on NEED_MULTIPLE_NODES - # LARGE_VMALLOC is racy, if you *really* need it then fix it first config ALPHA_LARGE_VMALLOC bool
arch/alpha/include/asm/machvec.h +0 -6
@@ -99,12 +99,6 @@ struct alpha_machine_vectorconst char *vector_name; -/* NUMA information */ -int (*pa_to_nid)(unsigned long ); -int (*cpuid_to_nid)(int ); -unsigned long (*node_mem_start)(int ); -unsigned long (*node_mem_size)(int ); -/* System specific parameters. */ union { struct {
arch/alpha/include/asm/mmzone.h deleted +0 -100
100 lines not on this page · raw message
arch/alpha/include/asm/pgtable.h +0 -4
@@ -206,7 +206,6 @@ extern unsigned long __zero_page(void);#define page_to_pa (page) (page_to_pfn(page) << PAGE_SHIFT)#define pte_pfn (pte) (pte_val(pte) >> 32) -#ifndef CONFIG_DISCONTIGMEM #define pte_page (pte) pfn_to_page(pte_pfn(pte))#define mk_pte (page, pgprot) \ ({ \
@@ -215,7 +214,6 @@ extern unsigned long __zero_page(void);pte_val (pte) = (page_to_pfn (page) <<32 ) |pgprot_val (pgprot); \ pte; \ }) -#endif extern inline pte_t pfn_pte (unsigned long physpfn,pgprot_t pgprot) {pte_t pte;pte_val (pte) = (PHYS_TWIDDLE (physpfn) <<32 ) |pgprot_val (pgprot);return pte; }
@@ -330,9 +328,7 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)#define __pte_to_swp_entry (pte) ((swp_entry_t) { pte_val(pte) })#define __swp_entry_to_pte (x) ((pte_t) { (x).val }) -#ifndef CONFIG_DISCONTIGMEM #define kern_addr_valid (addr) (1) -#endif #define pte_ERROR (e) \ printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
arch/alpha/include/asm/topology.h +0 -39
@@ -7,45 +7,6 @@#include <linux/numa.h> #include <asm/machvec.h> -#ifdef CONFIG_NUMA -static inline int cpu_to_node (int cpu) -{ -int node; - -if (!alpha_mv.cpuid_to_nid) -return 0 ; - - node = alpha_mv.cpuid_to_nid (cpu); - -#ifdef DEBUG_NUMA -BUG_ON (node <0 ); -#endif - -return node; -} - -extern struct cpumask node_to_cpumask_map[]; -/* FIXME: This is dumb, recalculating every time. But simple. */ -static const struct cpumask *cpumask_of_node (int node) -{ -int cpu; - -if (node ==NUMA_NO_NODE ) -return cpu_all_mask; - -cpumask_clear (&node_to_cpumask_map[node]); - -for_each_online_cpu (cpu) { -if (cpu_to_node (cpu) == node) -cpumask_set_cpu (cpu, node_to_cpumask_map[node]); - } - -return &node_to_cpumask_map[node]; -} - -#define cpumask_of_pcibus (bus) (cpu_online_mask) - -#endif /* !CONFIG_NUMA */ # include <asm-generic/topology.h> #endif /* _ASM_ALPHA_TOPOLOGY_H */
arch/alpha/kernel/core_marvel.c +3 -50
72 lines not on this page · raw message
arch/alpha/kernel/core_wildfire.c +1 -28
@@ -434,39 +434,12 @@ wildfire_write_config(struct pci_bus *bus, unsigned int devfn, int where,return PCIBIOS_SUCCESSFUL ; } -struct pci_ops wildfire_pci_ops = +struct pci_ops wildfire_pci_ops = { .read = wildfire_read_config, .write = wildfire_write_config, }; - -/* -* NUMA Support -*/ -int wildfire_pa_to_nid (unsigned long pa) -{ -return pa >>36 ; -} - -int wildfire_cpuid_to_nid (int cpuid) -{ -/* assume 4 CPUs per node */ -return cpuid >>2 ; -} - -unsigned long wildfire_node_mem_start (int nid) -{ -/* 64GB per node */ -return (unsigned long )nid * (64UL *1024 *1024 *1024 ); -} - -unsigned long wildfire_node_mem_size (int nid) -{ -/* 64GB per node */ -return 64UL *1024 *1024 *1024 ; -} -#if DEBUG_DUMP_REGS static void __init
arch/alpha/kernel/pci_iommu.c +0 -29
@@ -71,33 +71,6 @@ iommu_arena_new_node(int nid, struct pci_controller *hose, dma_addr_t base,if (align < mem_size) align = mem_size; - -#ifdef CONFIG_DISCONTIGMEM - - arena =memblock_alloc_node (sizeof (*arena), align, nid); -if (!NODE_DATA (nid) || !arena) { -printk ("%s: couldn't allocate arena from node %d\n" -" falling back to system-wide allocation\n" , - __func__, nid); - arena =memblock_alloc (sizeof (*arena),SMP_CACHE_BYTES ); -if (!arena) -panic ("%s: Failed to allocate %zu bytes\n" , __func__, -sizeof (*arena)); - } - - arena->ptes =memblock_alloc_node (sizeof (*arena), align, nid); -if (!NODE_DATA (nid) || !arena->ptes) { -printk ("%s: couldn't allocate arena ptes from node %d\n" -" falling back to system-wide allocation\n" , - __func__, nid); - arena->ptes =memblock_alloc (mem_size, align); -if (!arena->ptes) -panic ("%s: Failed to allocate %lu bytes align=0x%lx\n" , - __func__, mem_size, align); - } - -#else /* CONFIG_DISCONTIGMEM */ - arena =memblock_alloc (sizeof (*arena),SMP_CACHE_BYTES );if (!arena) panic("%s: Failed to allocate %zu bytes\n", __func__,
@@ -107,8 +80,6 @@ iommu_arena_new_node(int nid, struct pci_controller *hose, dma_addr_t base,panic ("%s: Failed to allocate %lu bytes align=0x%lx\n" , __func__, mem_size, align); -#endif /* CONFIG_DISCONTIGMEM */ -spin_lock_init (&arena->lock); arena->hose = hose; arena->dma_base = base;
arch/alpha/kernel/proto.h +0 -8
@@ -49,10 +49,6 @@ extern void marvel_init_arch(void);extern void marvel_kill_arch (int );extern void marvel_machine_check (unsigned long ,unsigned long );extern void marvel_pci_tbi (struct pci_controller *,dma_addr_t ,dma_addr_t ); -extern int marvel_pa_to_nid (unsigned long ); -extern int marvel_cpuid_to_nid (int ); -extern unsigned long marvel_node_mem_start (int ); -extern unsigned long marvel_node_mem_size (int );extern struct _alpha_agp_info *marvel_agp_info (void );struct io7 *marvel_find_io7 (int pe);struct io7 *marvel_next_io7 (struct io7 *prev);
@@ -101,10 +97,6 @@ extern void wildfire_init_arch(void);extern void wildfire_kill_arch (int );extern void wildfire_machine_check (unsigned long vector,unsigned long la_ptr);extern void wildfire_pci_tbi (struct pci_controller *,dma_addr_t ,dma_addr_t ); -extern int wildfire_pa_to_nid (unsigned long ); -extern int wildfire_cpuid_to_nid (int ); -extern unsigned long wildfire_node_mem_start (int ); -extern unsigned long wildfire_node_mem_size (int );/* console.c */ #ifdef CONFIG_VGA_HOSE
arch/alpha/kernel/setup.c +0 -16
@@ -79,11 +79,6 @@ int alpha_l3_cacheshape;unsigned long alpha_verbose_mcheck =CONFIG_VERBOSE_MCHECK_ON ;#endif -#ifdef CONFIG_NUMA -struct cpumask node_to_cpumask_map[MAX_NUMNODES ]__read_mostly ; -EXPORT_SYMBOL (node_to_cpumask_map); -#endif -/* Which processor we booted from. */ int boot_cpuid;
@@ -305,7 +300,6 @@ move_initrd(unsigned long mem_limit) }#endif -#ifndef CONFIG_DISCONTIGMEM static void __init setup_memory (void *kernel_end) {
@@ -389,9 +383,6 @@ setup_memory(void *kernel_end) }#endif /* CONFIG_BLK_DEV_INITRD */ } -#else -extern void setup_memory (void *); -#endif /* !CONFIG_DISCONTIGMEM */ int __init page_is_ram (unsigned long pfn)
@@ -618,13 +609,6 @@ setup_arch(char **cmdline_p) "VERBOSE_MCHECK "#endif -#ifdef CONFIG_DISCONTIGMEM -"DISCONTIGMEM " -#ifdef CONFIG_NUMA - "NUMA " -#endif -#endif -#ifdef CONFIG_DEBUG_SPINLOCK "DEBUG_SPINLOCK "#endif
arch/alpha/kernel/sys_marvel.c +0 -5
@@ -461,10 +461,5 @@ struct alpha_machine_vector marvel_ev7_mv __initmv = { .kill_arch = marvel_kill_arch, .pci_map_irq = marvel_map_irq, .pci_swizzle = common_swizzle, - - .pa_to_nid = marvel_pa_to_nid, - .cpuid_to_nid = marvel_cpuid_to_nid, - .node_mem_start = marvel_node_mem_start, - .node_mem_size = marvel_node_mem_size, };ALIAS_MV (marvel_ev7)
arch/alpha/kernel/sys_wildfire.c +0 -5
@@ -337,10 +337,5 @@ struct alpha_machine_vector wildfire_mv __initmv = { .kill_arch = wildfire_kill_arch, .pci_map_irq = wildfire_map_irq, .pci_swizzle = common_swizzle, - - .pa_to_nid = wildfire_pa_to_nid, - .cpuid_to_nid = wildfire_cpuid_to_nid, - .node_mem_start = wildfire_node_mem_start, - .node_mem_size = wildfire_node_mem_size, };ALIAS_MV (wildfire)
arch/alpha/mm/Makefile +0 -2
@@ -6,5 +6,3 @@ ccflags-y := -Werror obj-y := init.o fault.o - -obj-$(CONFIG_DISCONTIGMEM) += numa.o
arch/alpha/mm/init.c +0 -3
@@ -235,8 +235,6 @@ callback_init(void * kernel_end)return kernel_end; } - -#ifndef CONFIG_DISCONTIGMEM /* * paging_init() sets up the memory map. */
@@ -257,7 +255,6 @@ void __init paging_init(void)/* Initialize the kernel's ZERO_PGE. */ memset ((void *)ZERO_PGE ,0 ,PAGE_SIZE ); } -#endif /* CONFIG_DISCONTIGMEM */ #if defined(CONFIG_ALPHA_GENERIC ) || defined(CONFIG_ALPHA_SRM )void
arch/alpha/mm/numa.c deleted +0 -223
223 lines not on this page · raw message
Signature · 7 lines
2.28.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Mike Rapoport
maintainerPATCH v3 2/9 arc: update comment about HIGHMEM implementation
In reply to Mike RapoportFrom: Mike Rapoport <[email protected]>
Arc does not use DISCONTIGMEM to implement high memory, update the comment describing how high memory works to reflect this.
--- arch/arc/mm/init.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
arch/arc/mm/init.c +5 -8
@@ -139,16 +139,13 @@ void __init setup_arch_memory(void)#ifdef CONFIG_HIGHMEM /* -* Populate a new node with highmem -* * On ARC (w/o PAE) HIGHMEM addresses are actually smaller (0 based) -* than addresses in normal ala low memory (0x8000_0000 based). +* than addresses in normal aka low memory (0x8000_0000 based). * Even with PAE, the huge peripheral space hole would waste a lot of -* mem with single mem_map[]. This warrants a mem_map per region design. -* Thus HIGHMEM on ARC is imlemented with DISCONTIGMEM. -* -* DISCONTIGMEM in turns requires multiple nodes. node 0 above is -* populated with normal memory zone while node 1 only has highmem +* mem with single contiguous mem_map[]. +* Thus when HIGHMEM on ARC is enabled the memory map corresponding +* to the hole is freed and ARC specific version of pfn_valid() +* handles the hole in the memory map. */ #ifdef CONFIG_DISCONTIGMEM node_set_online (1 );
Signature · 7 lines
2.28.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Mike Rapoport
maintainerPATCH v3 3/9 arc: remove support for DISCONTIGMEM
In reply to Mike RapoportFrom: Mike Rapoport <[email protected]>
DISCONTIGMEM was replaced by FLATMEM with freeing of the unused memory map in v5.11.
Remove the support for DISCONTIGMEM entirely.
--- arch/arc/Kconfig | 13 ------------ arch/arc/include/asm/mmzone.h | 40 ----------------------------------- arch/arc/mm/init.c | 8 ------- 3 files changed, 61 deletions(-) delete mode 100644 arch/arc/include/asm/mmzone.h
arch/arc/Kconfig +0 -13
@@ -62,10 +62,6 @@ config SCHED_OMIT_FRAME_POINTER config GENERIC_CSUM def_bool y -config ARCH_DISCONTIGMEM_ENABLE - def_bool n - depends on BROKEN - config ARCH_FLATMEM_ENABLE def_bool y
@@ -344,15 +340,6 @@ config ARC_HUGEPAGE_16M endchoice -config NODES_SHIFT - int "Maximum NUMA Nodes (as a power of 2)" - default "0" if !DISCONTIGMEM - default "1" if DISCONTIGMEM - depends on NEED_MULTIPLE_NODES - help - Accessing memory beyond 1GB (with or w/o PAE) requires 2 memory - zones. - config ARC_COMPACT_IRQ_LEVELS depends on ISA_ARCOMPACT bool "Setup Timer IRQ as high Priority"
arch/arc/include/asm/mmzone.h deleted +0 -40
@@ -1,40 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* -* Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com) -*/ - -#ifndef _ASM_ARC_MMZONE_H -#define _ASM_ARC_MMZONE_H - -#ifdef CONFIG_DISCONTIGMEM - -extern struct pglist_data node_data[]; -#define NODE_DATA (nid) (&node_data[nid]) - -static inline int pfn_to_nid (unsigned long pfn) -{ -int is_end_low =1 ; - -if (IS_ENABLED (CONFIG_ARC_HAS_PAE40 )) - is_end_low = pfn <=virt_to_pfn (0xFFFFFFFFUL ); - -/* -* node 0: lowmem: 0x8000_0000 to 0xFFFF_FFFF -* node 1: HIGHMEM w/o PAE40: 0x0 to 0x7FFF_FFFF -* HIGHMEM with PAE40: 0x1_0000_0000 to ... -*/ -if (pfn >=ARCH_PFN_OFFSET && is_end_low) -return 0 ; - -return 1 ; -} - -static inline int pfn_valid (unsigned long pfn) -{ -int nid =pfn_to_nid (pfn); - -return (pfn <=node_end_pfn (nid)); -} -#endif /* CONFIG_DISCONTIGMEM */ - -#endif
arch/arc/mm/init.c +0 -8
@@ -32,11 +32,6 @@ unsigned long arch_pfn_offset;EXPORT_SYMBOL (arch_pfn_offset);#endif -#ifdef CONFIG_DISCONTIGMEM -struct pglist_data node_data[MAX_NUMNODES ]__read_mostly ; -EXPORT_SYMBOL (node_data); -#endif -long __init arc_get_mem_sz (void ) {return low_mem_sz;
@@ -147,9 +142,6 @@ void __init setup_arch_memory(void)* to the hole is freed and ARC specific version of pfn_valid() * handles the hole in the memory map. */ -#ifdef CONFIG_DISCONTIGMEM -node_set_online (1 ); -#endif min_high_pfn =PFN_DOWN (high_mem_start); max_high_pfn =PFN_DOWN (high_mem_start + high_mem_sz);
Signature · 7 lines
2.28.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Mike Rapoport
maintainerPATCH v3 4/9 m68k: remove support for DISCONTIGMEM
In reply to Mike RapoportFrom: Mike Rapoport <[email protected]>
DISCONTIGMEM was replaced by FLATMEM with freeing of the unused memory map in v5.11.
Remove the support for DISCONTIGMEM entirely.
--- arch/m68k/Kconfig.cpu | 10 ---------- arch/m68k/include/asm/mmzone.h | 10 ---------- arch/m68k/include/asm/page.h | 2 +- arch/m68k/include/asm/page_mm.h | 35 --------------------------------- arch/m68k/mm/init.c | 20 ------------------- 5 files changed, 1 insertion(+), 76 deletions(-) delete mode 100644 arch/m68k/include/asm/mmzone.h
arch/m68k/Kconfig.cpu +0 -10
@@ -408,10 +408,6 @@ config SINGLE_MEMORY_CHUNK order" to save memory that could be wasted for unused memory map. Say N if not sure. -config ARCH_DISCONTIGMEM_ENABLE - depends on BROKEN - def_bool MMU && !SINGLE_MEMORY_CHUNK - config FORCE_MAX_ZONEORDER int "Maximum zone order" if ADVANCED depends on !SINGLE_MEMORY_CHUNK
@@ -451,11 +447,6 @@ config M68K_L2_CACHE depends on MAC default y -config NODES_SHIFT - int - default "3" - depends on DISCONTIGMEM - config CPU_HAS_NO_BITFIELDS bool
@@ -553,4 +544,3 @@ config CACHE_COPYBACK The ColdFire CPU cache is set into Copy-back mode. endchoice endif -
arch/m68k/include/asm/mmzone.h deleted +0 -10
@@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M68K_MMZONE_H_ -#define _ASM_M68K_MMZONE_H_ - -extern pg_data_t pg_data_map[]; - -#define NODE_DATA (nid) (&pg_data_map[nid]) -#define NODE_MEM_MAP (nid) (NODE_DATA(nid)->node_mem_map) - -#endif /* _ASM_M68K_MMZONE_H_ */
arch/m68k/include/asm/page.h +1 -1
@@ -62,7 +62,7 @@ extern unsigned long _ramend;#include <asm/page_no.h> #endif -#if !defined(CONFIG_MMU ) || defined(CONFIG_DISCONTIGMEM ) +#ifndef CONFIG_MMU #define __phys_to_pfn (paddr) ((unsigned long)((paddr) >> PAGE_SHIFT))#define __pfn_to_phys (pfn) PFN_PHYS(pfn)#endif
arch/m68k/include/asm/page_mm.h +0 -35
@@ -126,26 +126,6 @@ static inline void *__va(unsigned long x)extern int m68k_virt_to_node_shift; -#ifndef CONFIG_DISCONTIGMEM -#define __virt_to_node (addr) (&pg_data_map[0]) -#else -extern struct pglist_data *pg_data_table[]; - -static inline __attribute_const__ int __virt_to_node_shift(void) -{ -int shift; - - asm ( - "1: moveq #0,%0\n" - m68k_fixup(%c1, 1b) - : "=d" (shift) - : "i" (m68k_fixup_vnode_shift)); -return shift; -} - -#define __virt_to_node (addr) (pg_data_table[(unsigned long)(addr) >> __virt_to_node_shift()]) -#endif -#define virt_to_page (addr) ({ \ pfn_to_page(virt_to_pfn(addr)); \ })
@@ -153,23 +133,8 @@ static inline __attribute_const__ int __virt_to_node_shift(void)pfn_to_virt (page_to_pfn (page)); \ }) -#ifdef CONFIG_DISCONTIGMEM -#define pfn_to_page (pfn) ({ \ - unsigned long __pfn = (pfn); \ - struct pglist_data *pgdat; \ - pgdat = __virt_to_node((unsigned long)pfn_to_virt(__pfn)); \ - pgdat->node_mem_map + (__pfn - pgdat->node_start_pfn); \ -}) -#define page_to_pfn (_page) ({ \ - const struct page *__p = (_page); \ - struct pglist_data *pgdat; \ - pgdat = &pg_data_map[page_to_nid(__p)]; \ - ((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn; \ -}) -#else #define ARCH_PFN_OFFSET (m68k_memory[0].addr >> PAGE_SHIFT)#include <asm-generic/memory_model.h> -#endif #define virt_addr_valid (kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)#define pfn_valid (pfn) virt_addr_valid(pfn_to_virt(pfn))
arch/m68k/mm/init.c +0 -20
@@ -44,28 +44,8 @@ EXPORT_SYMBOL(empty_zero_page);int m68k_virt_to_node_shift; -#ifdef CONFIG_DISCONTIGMEM -pg_data_t pg_data_map[MAX_NUMNODES ]; -EXPORT_SYMBOL (pg_data_map); - -pg_data_t *pg_data_table[65 ]; -EXPORT_SYMBOL (pg_data_table); -#endif -void __init m68k_setup_node (int node) { -#ifdef CONFIG_DISCONTIGMEM -struct m68k_mem_info *info = m68k_memory + node; -int i, end; - - i = (unsigned long )phys_to_virt (info->addr) >>__virt_to_node_shift (); - end = (unsigned long )phys_to_virt (info->addr + info->size -1 ) >>__virt_to_node_shift (); -for (; i <= end; i++) { -if (pg_data_table[i]) -pr_warn ("overlap at %u for chunk %u\n" , i, node); - pg_data_table[i] = pg_data_map + node; - } -#endif node_set_online (node); }
Signature · 7 lines
2.28.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Mike Rapoport
maintainerPATCH v3 5/9 mm: remove CONFIG_DISCONTIGMEM
In reply to Mike RapoportFrom: Mike Rapoport <[email protected]>
There are no architectures that support DISCONTIGMEM left.
Remove the configuration option and the dead code it was guarding in the generic memory management code.
--- include/asm-generic/memory_model.h | 37 ++++-------------------------- include/linux/mmzone.h | 8 ++++--- mm/Kconfig | 25 +++----------------- mm/page_alloc.c | 13 ----------- 4 files changed, 12 insertions(+), 71 deletions(-)
include/asm-generic/memory_model.h +4 -33
@@ -6,47 +6,18 @@#ifndef __ASSEMBLY__ +/* +* supports 3 memory models. +*/ #if defined(CONFIG_FLATMEM )#ifndef ARCH_PFN_OFFSET #define ARCH_PFN_OFFSET (0UL)#endif -#elif defined(CONFIG_DISCONTIGMEM ) - -#ifndef arch_pfn_to_nid -#define arch_pfn_to_nid (pfn) pfn_to_nid(pfn) -#endif - -#ifndef arch_local_page_offset -#define arch_local_page_offset (pfn, nid) \ - ((pfn) - NODE_DATA(nid)->node_start_pfn) -#endif - -#endif /* CONFIG_DISCONTIGMEM */ - -/* -* supports 3 memory models. -*/ -#if defined(CONFIG_FLATMEM ) -#define __pfn_to_page (pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET))#define __page_to_pfn (page) ((unsigned long)((page) - mem_map) + \ ARCH_PFN_OFFSET) -#elif defined(CONFIG_DISCONTIGMEM ) - -#define __pfn_to_page (pfn) \ -({ unsigned long __pfn = (pfn); \ - unsigned long __nid = arch_pfn_to_nid(__pfn); \ - NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ -}) - -#define __page_to_pfn (pg) \ -({ const struct page *__pg = (pg); \ - struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ - (unsigned long)(__pg - __pgdat->node_mem_map) + \ - __pgdat->node_start_pfn; \ -})#elif defined(CONFIG_SPARSEMEM_VMEMMAP )
@@ -70,7 +41,7 @@struct mem_section *__sec =__pfn_to_section (__pfn); \__section_mem_map_addr (__sec) + __pfn; \ }) -#endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ +#endif /* CONFIG_FLATMEM/SPARSEMEM */ /* * Convert a physical address to a Page Frame Number and back
include/linux/mmzone.h +5 -3
@@ -738,10 +738,12 @@ struct zonelist {struct zoneref _zonerefs[MAX_ZONES_PER_ZONELIST +1 ]; }; -#ifndef CONFIG_DISCONTIGMEM -/* The array of struct pages - for discontigmem use pgdat->lmem_map */ +/* +* The array of struct pages for flatmem. +* It must be declared for SPARSEMEM as well because there are configurations +* that rely on that. +*/ extern struct page *mem_map; -#endif #ifdef CONFIG_TRANSPARENT_HUGEPAGE struct deferred_split {
mm/Kconfig +3 -22
@@ -19,7 +19,7 @@ choice config FLATMEM_MANUAL bool "Flat Memory" - depends on !(ARCH_DISCONTIGMEM_ENABLE || ARCH_SPARSEMEM_ENABLE) || ARCH_FLATMEM_ENABLE + depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE help This option is best suited for non-NUMA systems with flat address space. The FLATMEM is the most efficient
@@ -32,21 +32,6 @@ config FLATMEM_MANUAL If unsure, choose this option (Flat Memory) over any other. -config DISCONTIGMEM_MANUAL - bool "Discontiguous Memory" - depends on ARCH_DISCONTIGMEM_ENABLE - help - This option provides enhanced support for discontiguous - memory systems, over FLATMEM. These systems have holes - in their physical address spaces, and this option provides - more efficient handling of these holes. - - Although "Discontiguous Memory" is still used by several - architectures, it is considered deprecated in favor of - "Sparse Memory". - - If unsure, choose "Sparse Memory" over this option. - config SPARSEMEM_MANUAL bool "Sparse Memory" depends on ARCH_SPARSEMEM_ENABLE
@@ -62,17 +47,13 @@ config SPARSEMEM_MANUAL endchoice -config DISCONTIGMEM - def_bool y - depends on (!SELECT_MEMORY_MODEL && ARCH_DISCONTIGMEM_ENABLE) || DISCONTIGMEM_MANUAL - config SPARSEMEM def_bool y depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL config FLATMEM def_bool y - depends on (!DISCONTIGMEM && !SPARSEMEM) || FLATMEM_MANUAL + depends on !SPARSEMEM || FLATMEM_MANUAL config FLAT_NODE_MEM_MAP def_bool y
@@ -85,7 +66,7 @@ config FLAT_NODE_MEM_MAP # config NEED_MULTIPLE_NODES def_bool y - depends on DISCONTIGMEM || NUMA + depends on NUMA # # SPARSEMEM_EXTREME (which is the default) does some bootmem
mm/page_alloc.c +0 -13
@@ -331,20 +331,7 @@ compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS] = {int min_free_kbytes =1024 ;int user_min_free_kbytes =-1 ; -#ifdef CONFIG_DISCONTIGMEM -/* -* DiscontigMem defines memory ranges as separate pg_data_t even if the ranges -* are not on separate NUMA nodes. Functionally this works but with -* watermark_boost_factor, it can reclaim prematurely as the ranges can be -* quite small. By default, do not boost watermarks on discontigmem as in -* many cases very high-order allocations like THP are likely to be -* unsupported and the premature reclaim offsets the advantage of long-term -* fragmentation avoidance. -*/ -int watermark_boost_factor__read_mostly ; -#else int watermark_boost_factor__read_mostly =15000 ; -#endif int watermark_scale_factor =10 ;static unsigned long nr_kernel_pages__initdata ;
Signature · 7 lines
2.28.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Mike Rapoport
maintainerPATCH v3 6/9 arch, mm: remove stale mentions of DISCONIGMEM
In reply to Mike RapoportFrom: Mike Rapoport <[email protected]>
There are several places that mention DISCONIGMEM in comments or have stale code guarded by CONFIG_DISCONTIGMEM.
Remove the dead code and update the comments.
--- arch/ia64/kernel/topology.c | 5 ++--- arch/ia64/mm/numa.c | 5 ++--- arch/mips/include/asm/mmzone.h | 6 ------ arch/mips/mm/init.c | 3 --- arch/nds32/include/asm/memory.h | 6 ------ arch/xtensa/include/asm/page.h | 4 ---- include/linux/gfp.h | 4 ++-- 7 files changed, 6 insertions(+), 27 deletions(-)
arch/ia64/kernel/topology.c +2 -3
@@ -3,9 +3,8 @@* License. See the file "COPYING" in the main directory of this archive * for more details. * -* This file contains NUMA specific variables and functions which can -* be split away from DISCONTIGMEM and are used on NUMA machines with -* contiguous memory. +* This file contains NUMA specific variables and functions which are used on +* NUMA machines with contiguous memory. * 2002/08/07 Erich Focht <[email protected]> * Populate cpu entries in sysfs for non-numa systems as well * Intel Corporation - Ashok Raj
arch/ia64/mm/numa.c +2 -3
@@ -3,9 +3,8 @@* License. See the file "COPYING" in the main directory of this archive * for more details. * -* This file contains NUMA specific variables and functions which can -* be split away from DISCONTIGMEM and are used on NUMA machines with -* contiguous memory. +* This file contains NUMA specific variables and functions which are used on +* NUMA machines with contiguous memory. * * 2002/08/07 Erich Focht <[email protected]> */
arch/mips/include/asm/mmzone.h +0 -6
@@ -20,10 +20,4 @@#define nid_to_addrbase (nid) 0#endif -#ifdef CONFIG_DISCONTIGMEM - -#define pfn_to_nid (pfn) pa_to_nid((pfn) << PAGE_SHIFT) - -#endif /* CONFIG_DISCONTIGMEM */ -#endif /* _ASM_MMZONE_H_ */
arch/mips/mm/init.c +0 -3
@@ -454,9 +454,6 @@ void __init mem_init(void)BUILD_BUG_ON (IS_ENABLED (CONFIG_32BIT ) && (_PFN_SHIFT >PAGE_SHIFT ));#ifdef CONFIG_HIGHMEM -#ifdef CONFIG_DISCONTIGMEM -#error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet" -#endif max_mapnr = highend_pfn ? highend_pfn : max_low_pfn;#else max_mapnr = max_low_pfn;
arch/nds32/include/asm/memory.h +0 -6
@@ -76,18 +76,12 @@* virt_to_page(k) convert a _valid_ virtual address to struct page * * virt_addr_valid(k) indicates whether a virtual address is valid */ -#ifndef CONFIG_DISCONTIGMEM -#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET#define pfn_valid (pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))#define virt_to_page (kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT))#define virt_addr_valid (kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) -#else /* CONFIG_DISCONTIGMEM */ -#error CONFIG_DISCONTIGMEM is not supported yet. -#endif /* !CONFIG_DISCONTIGMEM */ -#define page_to_phys (page) (page_to_pfn(page) << PAGE_SHIFT)#endif
arch/xtensa/include/asm/page.h +0 -4
@@ -192,10 +192,6 @@ static inline unsigned long ___pa(unsigned long va)#define pfn_valid (pfn) \ ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr) -#ifdef CONFIG_DISCONTIGMEM -# error CONFIG_DISCONTIGMEM not supported -#endif -#define virt_to_page (kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)#define page_to_virt (page) __va(page_to_pfn(page) << PAGE_SHIFT)#define virt_addr_valid (kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
include/linux/gfp.h +2 -2
@@ -494,8 +494,8 @@ static inline int gfp_zonelist(gfp_t flags)* There are two zonelists per node, one for all zones with memory and * one containing just zones from the node the zonelist belongs to. * -* For the normal case of non-DISCONTIGMEM systems the NODE_DATA() gets -* optimized to &contig_page_data at compile-time. +* For the case of non-NUMA systems the NODE_DATA() gets optimized to +* &contig_page_data at compile-time. */ static inline struct zonelist *node_zonelist (int nid,gfp_t flags) {
Signature · 7 lines
2.28.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Mike Rapoport
maintainerPATCH v3 7/9 docs: remove description of DISCONTIGMEM
In reply to Mike RapoportFrom: Mike Rapoport <[email protected]>
Remove description of DISCONTIGMEM from the "Memory Models" document and update VM sysctl description so that it won't mention DISCONIGMEM.
--- Documentation/admin-guide/sysctl/vm.rst | 12 +++---- Documentation/vm/memory-model.rst | 45 ++----------------------- 2 files changed, 8 insertions(+), 49 deletions(-)
Documentation/admin-guide/sysctl/vm.rst +6 -6
@@ -936,12 +936,12 @@ allocations, THP and hugetlbfs pages. To make it sensible with respect to the watermark_scale_factor parameter, the unit is in fractions of 10,000. The default value of -15,000 on !DISCONTIGMEM configurations means that up to 150% of the high -watermark will be reclaimed in the event of a pageblock being mixed due -to fragmentation. The level of reclaim is determined by the number of -fragmentation events that occurred in the recent past. If this value is -smaller than a pageblock then a pageblocks worth of pages will be reclaimed -(e.g. 2MB on 64-bit x86). A boost factor of 0 will disable the feature. +15,000 means that up to 150% of the high watermark will be reclaimed in the +event of a pageblock being mixed due to fragmentation. The level of reclaim +is determined by the number of fragmentation events that occurred in the +recent past. If this value is smaller than a pageblock then a pageblocks +worth of pages will be reclaimed (e.g. 2MB on 64-bit x86). A boost factor +of 0 will disable the feature. watermark_scale_factor
Documentation/vm/memory-model.rst +2 -43
60 lines not on this page · raw message
Signature · 7 lines
2.28.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Mike Rapoport
maintainerPATCH v3 8/9 mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA
In reply to Mike RapoportFrom: Mike Rapoport <[email protected]>
After removal of DISCINTIGMEM the NEED_MULTIPLE_NODES and NUMA configuration options are equivalent.
Drop CONFIG_NEED_MULTIPLE_NODES and use CONFIG_NUMA instead.
Done with
$ sed -i 's/CONFIG_NEED_MULTIPLE_NODES/CONFIG_NUMA/' \ $(git grep -wl CONFIG_NEED_MULTIPLE_NODES) $ sed -i 's/NEED_MULTIPLE_NODES/NUMA/' \ $(git grep -wl NEED_MULTIPLE_NODES)
with manual tweaks afterwards.
--- arch/arm64/Kconfig | 2 +- arch/ia64/Kconfig | 2 +- arch/mips/Kconfig | 2 +- arch/mips/include/asm/mmzone.h | 2 +- arch/mips/include/asm/page.h | 2 +- arch/mips/mm/init.c | 4 ++-- arch/powerpc/Kconfig | 2 +- arch/powerpc/include/asm/mmzone.h | 4 ++-- arch/powerpc/kernel/setup_64.c | 2 +- arch/powerpc/kernel/smp.c | 2 +- arch/powerpc/kexec/core.c | 4 ++-- arch/powerpc/mm/Makefile | 2 +- arch/powerpc/mm/mem.c | 4 ++-- arch/riscv/Kconfig | 2 +- arch/s390/Kconfig | 2 +- arch/sh/include/asm/mmzone.h | 4 ++-- arch/sh/kernel/topology.c | 2 +- arch/sh/mm/Kconfig | 2 +- arch/sh/mm/init.c | 2 +- arch/sparc/Kconfig | 2 +- arch/sparc/include/asm/mmzone.h | 4 ++-- arch/sparc/kernel/smp_64.c | 2 +- arch/sparc/mm/init_64.c | 12 ++++++------ arch/x86/Kconfig | 2 +- arch/x86/kernel/setup_percpu.c | 6 +++--- arch/x86/mm/init_32.c | 4 ++-- include/asm-generic/topology.h | 2 +- include/linux/memblock.h | 6 +++--- include/linux/mm.h | 4 ++-- include/linux/mmzone.h | 8 ++++---- kernel/crash_core.c | 2 +- mm/Kconfig | 9 --------- mm/memblock.c | 8 ++++---- mm/memory.c | 3 +-- mm/page_alloc.c | 6 +++--- 35 files changed, 59 insertions(+), 69 deletions(-)
arch/arm64/Kconfig +1 -1
@@ -1035,7 +1035,7 @@ config NODES_SHIFT int "Maximum NUMA Nodes (as a power of 2)" range 1 10 default "4" - depends on NEED_MULTIPLE_NODES + depends on NUMA help Specify the maximum number of NUMA Nodes available on the target system. Increases memory reserved to accommodate various tables.
arch/ia64/Kconfig +1 -1
@@ -302,7 +302,7 @@ config NODES_SHIFT int "Max num nodes shift(3-10)" range 3 10 default "10" - depends on NEED_MULTIPLE_NODES + depends on NUMA help This option specifies the maximum number of nodes in your SSI system. MAX_NUMNODES will be 2^(This value).
arch/mips/Kconfig +1 -1
@@ -2867,7 +2867,7 @@ config RANDOMIZE_BASE_MAX_OFFSET config NODES_SHIFT int default "6" - depends on NEED_MULTIPLE_NODES + depends on NUMA config HW_PERF_EVENTS bool "Enable hardware performance counter support for perf events"
arch/mips/include/asm/mmzone.h +1 -1
@@ -8,7 +8,7 @@#include <asm/page.h> -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA # include <mmzone.h> #endif
arch/mips/include/asm/page.h +1 -1
@@ -239,7 +239,7 @@ static inline int pfn_valid(unsigned long pfn)/* pfn_valid is defined in linux/mmzone.h */ -#elif defined(CONFIG_NEED_MULTIPLE_NODES ) +#elif defined(CONFIG_NUMA )#define pfn_valid (pfn) \ ({ \
arch/mips/mm/init.c +2 -2
@@ -394,7 +394,7 @@ void maar_init(void) } } -#ifndef CONFIG_NEED_MULTIPLE_NODES +#ifndef CONFIG_NUMA void __init paging_init (void ) {unsigned long max_zone_pfns[MAX_NR_ZONES ];
@@ -473,7 +473,7 @@ void __init mem_init(void) 0x80000000 - 4, KCORE_TEXT); #endif } -#endif /* !CONFIG_NEED_MULTIPLE_NODES */ +#endif /* !CONFIG_NUMA */ void free_init_pages (const char *what,unsigned long begin,unsigned long end) {
arch/powerpc/Kconfig +1 -1
@@ -671,7 +671,7 @@ config NODES_SHIFT int default "8" if PPC64 default "4" - depends on NEED_MULTIPLE_NODES + depends on NUMA config USE_PERCPU_NUMA_NODE_ID def_bool y
arch/powerpc/include/asm/mmzone.h +2 -2
@@ -18,7 +18,7 @@* flags field of the struct page */ -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA extern struct pglist_data *node_data[];/*
@@ -41,7 +41,7 @@ u64 memory_hotplug_max(void);#else #define memory_hotplug_max () memblock_end_of_DRAM() -#endif /* CONFIG_NEED_MULTIPLE_NODES */ +#endif /* CONFIG_NUMA */ #ifdef CONFIG_FA_DUMP #define __HAVE_ARCH_RESERVED_KERNEL_PAGES#endif
arch/powerpc/kernel/setup_64.c +1 -1
@@ -788,7 +788,7 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, size_t size, size_t align) {const unsigned long goal =__pa (MAX_DMA_ADDRESS ); -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA int node =early_cpu_to_node (cpu);void *ptr;
arch/powerpc/kernel/smp.c +1 -1
@@ -1047,7 +1047,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)zalloc_cpumask_var_node (&per_cpu (cpu_coregroup_map, cpu),GFP_KERNEL ,cpu_to_node (cpu)); -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA /* * numa_node_id() works after this. */
arch/powerpc/kexec/core.c +2 -2
@@ -68,11 +68,11 @@ void machine_kexec_cleanup(struct kimage *image)void arch_crash_save_vmcoreinfo (void ) { -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA VMCOREINFO_SYMBOL (node_data);VMCOREINFO_LENGTH (node_data,MAX_NUMNODES );#endif -#ifndef CONFIG_NEED_MULTIPLE_NODES +#ifndef CONFIG_NUMA VMCOREINFO_SYMBOL (contig_page_data);#endif #if defined(CONFIG_PPC64 ) && defined(CONFIG_SPARSEMEM_VMEMMAP )
arch/powerpc/mm/Makefile +1 -1
@@ -13,7 +13,7 @@ obj-y := fault.o mem.o pgtable.o mmap.o maccess.o \ obj-$(CONFIG_PPC_MMU_NOHASH) += nohash/ obj-$(CONFIG_PPC_BOOK3S_32) += book3s32/ obj-$(CONFIG_PPC_BOOK3S_64) += book3s64/ -obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o +obj-$(CONFIG_NUMA) += numa.o obj-$(CONFIG_PPC_MM_SLICES) += slice.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o
arch/powerpc/mm/mem.c +2 -2
@@ -126,7 +126,7 @@ void __ref arch_remove_memory(int nid, u64 start, u64 size, }#endif -#ifndef CONFIG_NEED_MULTIPLE_NODES +#ifndef CONFIG_NUMA void __init mem_topology_setup (void ) { max_low_pfn = max_pfn =memblock_end_of_DRAM () >>PAGE_SHIFT ;
@@ -161,7 +161,7 @@ static int __init mark_nonram_nosave(void) return 0; } -#else /* CONFIG_NEED_MULTIPLE_NODES */ +#else /* CONFIG_NUMA */ static int __init mark_nonram_nosave (void ) {return 0 ;
arch/riscv/Kconfig +1 -1
@@ -331,7 +331,7 @@ config NODES_SHIFT int "Maximum NUMA Nodes (as a power of 2)" range 1 10 default "2" - depends on NEED_MULTIPLE_NODES + depends on NUMA help Specify the maximum number of NUMA Nodes available on the target system. Increases memory reserved to accommodate various tables.
arch/s390/Kconfig +1 -1
@@ -475,7 +475,7 @@ config NUMA config NODES_SHIFT int - depends on NEED_MULTIPLE_NODES + depends on NUMA default "1" config SCHED_SMT
arch/sh/include/asm/mmzone.h +2 -2
@@ -2,7 +2,7 @@#ifndef __ASM_SH_MMZONE_H#define __ASM_SH_MMZONE_H -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA #include <linux/numa.h> extern struct pglist_data *node_data[];
@@ -31,7 +31,7 @@ static inline void setup_bootmem_node(int nid, unsigned long start, unsigned long end) { } -#endif /* CONFIG_NEED_MULTIPLE_NODES */ +#endif /* CONFIG_NUMA */ /* Platform specific mem init */ void __init plat_mem_setup (void );
arch/sh/kernel/topology.c +1 -1
@@ -46,7 +46,7 @@ static int __init topology_init(void) {int i, ret; -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA for_each_online_node (i)register_one_node (i);#endif
arch/sh/mm/Kconfig +1 -1
@@ -120,7 +120,7 @@ config NODES_SHIFT int default "3" if CPU_SUBTYPE_SHX3 default "1" - depends on NEED_MULTIPLE_NODES + depends on NUMA config ARCH_FLATMEM_ENABLE def_bool y
arch/sh/mm/init.c +1 -1
@@ -211,7 +211,7 @@ void __init allocate_pgdat(unsigned int nid)get_pfn_range_for_nid (nid, &start_pfn, &end_pfn); -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA NODE_DATA(nid) = memblock_alloc_try_nid( sizeof(struct pglist_data), SMP_CACHE_BYTES, MEMBLOCK_LOW_LIMIT,
arch/sparc/Kconfig +1 -1
@@ -265,7 +265,7 @@ config NODES_SHIFT int "Maximum NUMA Nodes (as a power of 2)" range 4 5 if SPARC64 default "5" - depends on NEED_MULTIPLE_NODES + depends on NUMA help Specify the maximum number of NUMA Nodes available on the target system. Increases memory reserved to accommodate various tables.
arch/sparc/include/asm/mmzone.h +2 -2
@@ -2,7 +2,7 @@#ifndef _SPARC64_MMZONE_H#define _SPARC64_MMZONE_H -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA #include <linux/cpumask.h>
@@ -13,6 +13,6 @@ extern struct pglist_data *node_data[];extern int numa_cpu_lookup_table[];extern cpumask_t numa_cpumask_lookup_table[]; -#endif /* CONFIG_NEED_MULTIPLE_NODES */ +#endif /* CONFIG_NUMA */ #endif /* _SPARC64_MMZONE_H */
arch/sparc/kernel/smp_64.c +1 -1
@@ -1546,7 +1546,7 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, size_t size, size_t align) {const unsigned long goal =__pa (MAX_DMA_ADDRESS ); -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA int node =cpu_to_node (cpu);void *ptr;
arch/sparc/mm/init_64.c +6 -6
@@ -903,7 +903,7 @@ struct node_mem_mask {static struct node_mem_mask node_masks[MAX_NUMNODES ];static int num_node_masks; -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA struct mdesc_mlgroup { u64 node;
@@ -1059,7 +1059,7 @@ static void __init allocate_node_data(int nid) {struct pglist_data *p;unsigned long start_pfn, end_pfn; -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA NODE_DATA (nid) =memblock_alloc_node (sizeof (struct pglist_data ),SMP_CACHE_BYTES , nid);
@@ -1080,7 +1080,7 @@ static void __init allocate_node_data(int nid)static void init_node_masks_nonnuma (void ) { -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA int i;#endif
@@ -1090,7 +1090,7 @@ static void init_node_masks_nonnuma(void) node_masks[0 ].match =0 ; num_node_masks =1 ; -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA for (i =0 ; i <NR_CPUS ; i++) numa_cpu_lookup_table[i] =0 ;
@@ -1098,7 +1098,7 @@ static void init_node_masks_nonnuma(void)#endif } -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA struct pglist_data *node_data[MAX_NUMNODES ];EXPORT_SYMBOL (numa_cpu_lookup_table);
@@ -2487,7 +2487,7 @@ int page_in_phys_avail(unsigned long paddr)static void __init register_page_bootmem_info (void ) { -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA int i;for_each_online_node (i)
arch/x86/Kconfig +1 -1
@@ -1597,7 +1597,7 @@ config NODES_SHIFT default "10" if MAXSMP default "6" if X86_64 default "3" - depends on NEED_MULTIPLE_NODES + depends on NUMA help Specify the maximum number of NUMA Nodes available on the target system. Increases memory reserved to accommodate various tables.
arch/x86/kernel/setup_percpu.c +3 -3
@@ -66,7 +66,7 @@ EXPORT_SYMBOL(__per_cpu_offset);*/ static bool __init pcpu_need_numa (void ) { -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA pg_data_t *last =NULL ;unsigned int cpu;
@@ -101,7 +101,7 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size, unsigned long align) {const unsigned long goal =__pa (MAX_DMA_ADDRESS ); -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA int node =early_cpu_to_node (cpu);void *ptr;
@@ -140,7 +140,7 @@ static void __init pcpu_fc_free(void *ptr, size_t size)static int __init pcpu_cpu_distance (unsigned int from,unsigned int to) { -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA if (early_cpu_to_node (from) ==early_cpu_to_node (to))return LOCAL_DISTANCE ;else
arch/x86/mm/init_32.c +2 -2
@@ -651,7 +651,7 @@ void __init find_low_pfn_range(void)highmem_pfn_init (); } -#ifndef CONFIG_NEED_MULTIPLE_NODES +#ifndef CONFIG_NUMA void __init initmem_init (void ) {#ifdef CONFIG_HIGHMEM
@@ -677,7 +677,7 @@ void __init initmem_init(void) setup_bootmem_allocator(); } -#endif /* !CONFIG_NEED_MULTIPLE_NODES */ +#endif /* !CONFIG_NUMA */ void __init setup_bootmem_allocator (void ) {
include/asm-generic/topology.h +1 -1
@@ -45,7 +45,7 @@#endif #ifndef cpumask_of_node -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA #define cpumask_of_node (node) ((node) == 0 ? cpu_online_mask : cpu_none_mask)#else #define cpumask_of_node (node) ((void)(node), cpu_online_mask)
include/linux/memblock.h +3 -3
@@ -50,7 +50,7 @@ struct memblock_region {phys_addr_t base;phys_addr_t size;enum memblock_flags flags; -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA int nid;#endif };
@@ -347,7 +347,7 @@ int __init deferred_page_init_max_threads(const struct cpumask *node_cpumask);int memblock_set_node (phys_addr_t base,phys_addr_t size,struct memblock_type *type,int nid); -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA static inline void memblock_set_region_node (struct memblock_region *r,int nid) { r->nid = nid;
@@ -366,7 +366,7 @@ static inline int memblock_get_region_node(const struct memblock_region *r) {return 0 ; } -#endif /* CONFIG_NEED_MULTIPLE_NODES */ +#endif /* CONFIG_NUMA */ /* Flags for memblock allocation APIs */ #define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0)
include/linux/mm.h +2 -2
@@ -46,7 +46,7 @@ extern int sysctl_page_lock_unfairness;void init_mm_internals (void ); -#ifndef CONFIG_NEED_MULTIPLE_NODES /* Don't use mapnrs, do it properly */ +#ifndef CONFIG_NUMA /* Don't use mapnrs, do it properly */ extern unsigned long max_mapnr;static inline void set_max_mapnr (unsigned long limit)
@@ -2457,7 +2457,7 @@ 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_NEED_MULTIPLE_NODES +#ifndef CONFIG_NUMA static inline int early_pfn_to_nid (unsigned long pfn) {return 0 ;
include/linux/mmzone.h +4 -4
@@ -987,7 +987,7 @@ extern int movable_zone;#ifdef CONFIG_HIGHMEM static inline int zone_movable_is_highmem (void ) { -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA return movable_zone ==ZONE_HIGHMEM ;#else return (ZONE_MOVABLE -1 ) ==ZONE_HIGHMEM ;
@@ -1043,17 +1043,17 @@ extern int percpu_pagelist_fraction;extern char numa_zonelist_order[];#define NUMA_ZONELIST_ORDER_LEN 16 -#ifndef CONFIG_NEED_MULTIPLE_NODES +#ifndef CONFIG_NUMA extern struct pglist_data contig_page_data;#define NODE_DATA (nid) (&contig_page_data)#define NODE_MEM_MAP (nid) mem_map -#else /* CONFIG_NEED_MULTIPLE_NODES */ +#else /* CONFIG_NUMA */ #include <asm/mmzone.h> -#endif /* !CONFIG_NEED_MULTIPLE_NODES */ +#endif /* !CONFIG_NUMA */ extern struct pglist_data *first_online_pgdat (void );extern struct pglist_data *next_online_pgdat (struct pglist_data *pgdat);
kernel/crash_core.c +1 -1
@@ -455,7 +455,7 @@ static int __init crash_save_vmcoreinfo_init(void)VMCOREINFO_SYMBOL (_stext);VMCOREINFO_SYMBOL (vmap_area_list); -#ifndef CONFIG_NEED_MULTIPLE_NODES +#ifndef CONFIG_NUMA VMCOREINFO_SYMBOL (mem_map);VMCOREINFO_SYMBOL (contig_page_data);#endif
mm/Kconfig +0 -9
@@ -59,15 +59,6 @@ config FLAT_NODE_MEM_MAP def_bool y depends on !SPARSEMEM -# -# Both the NUMA code and DISCONTIGMEM use arrays of pg_data_t's -# to represent different areas of memory. This variable allows -# those dependencies to exist individually. -# -config NEED_MULTIPLE_NODES - def_bool y - depends on NUMA - # # SPARSEMEM_EXTREME (which is the default) does some bootmem # allocations when sparse_init() is called. If this cannot
mm/memblock.c +4 -4
@@ -92,7 +92,7 @@* system initialization completes. */ -#ifndef CONFIG_NEED_MULTIPLE_NODES +#ifndef CONFIG_NUMA struct pglist_data __refdata contig_page_data;EXPORT_SYMBOL (contig_page_data);#endif
@@ -607,7 +607,7 @@ static int __init_memblock memblock_add_range(struct memblock_type *type,* area, insert that portion. */ if (rbase > base) { -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA WARN_ON (nid !=memblock_get_region_node (rgn));#endif WARN_ON (flags != rgn->flags);
@@ -1205,7 +1205,7 @@ void __init_memblock __next_mem_pfn_range(int *idx, int nid, int __init_memblock memblock_set_node(phys_addr_t base, phys_addr_t size,struct memblock_type *type,int nid) { -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA int start_rgn, end_rgn;int i, ret;
@@ -1849,7 +1849,7 @@ static void __init_memblock memblock_dump(struct memblock_type *type) size = rgn->size; end = base + size -1 ; flags = rgn->flags; -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA if (memblock_get_region_node (rgn) !=MAX_NUMNODES )snprintf (nid_buf,sizeof (nid_buf)," on node %d" ,memblock_get_region_node (rgn));
mm/memory.c +1 -2
@@ -90,8 +90,7 @@#warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid.#endif -#ifndef CONFIG_NEED_MULTIPLE_NODES -/* use the per-pgdat data instead for discontigmem - mbligh */ +#ifndef CONFIG_NUMA unsigned long max_mapnr;EXPORT_SYMBOL (max_mapnr);
mm/page_alloc.c +3 -3
@@ -1596,7 +1596,7 @@ void __free_pages_core(struct page *page, unsigned int order)__free_pages_ok (page, order,FPI_TO_TAIL |FPI_SKIP_KASAN_POISON ); } -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA /* * During memory init memblocks map pfns to nids. The search is expensive and
@@ -1646,7 +1646,7 @@ int __meminit early_pfn_to_nid(unsigned long pfn) return nid; } -#endif /* CONFIG_NEED_MULTIPLE_NODES */ +#endif /* CONFIG_NUMA */ void __init memblock_free_pages (struct page *page,unsigned long pfn,unsigned int order)
@@ -7276,7 +7276,7 @@ static void __ref alloc_node_mem_map(struct pglist_data *pgdat)pr_debug ("%s: node %d, pgdat %08lx, node_mem_map %08lx\n" , __func__, pgdat->node_id, (unsigned long )pgdat, (unsigned long )pgdat->node_mem_map); -#ifndef CONFIG_NEED_MULTIPLE_NODES +#ifndef CONFIG_NUMA /* * With no DISCONTIG, the global mem_map is just set as node 0's */
Signature · 7 lines
2.28.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Mike Rapoport
maintainerPATCH v3 9/9 mm: replace CONFIG_FLAT_NODE_MEM_MAP with CONFIG_FLATMEM
In reply to Mike RapoportFrom: Mike Rapoport <[email protected]>
After removal of the DISCONTIGMEM memory model the FLAT_NODE_MEM_MAP configuration option is equivalent to FLATMEM.
Drop CONFIG_FLAT_NODE_MEM_MAP and use CONFIG_FLATMEM instead.
--- include/linux/mmzone.h | 4 ++-- kernel/crash_core.c | 2 +- mm/Kconfig | 4 ---- mm/page_alloc.c | 6 +++--- mm/page_ext.c | 2 +- 5 files changed, 7 insertions(+), 11 deletions(-)
include/linux/mmzone.h +2 -2
@@ -777,7 +777,7 @@ typedef struct pglist_data {struct zonelist node_zonelists[MAX_ZONELISTS ];int nr_zones;/* number of populated zones in this node */ -#ifdef CONFIG_FLAT_NODE_MEM_MAP /* means !SPARSEMEM */ +#ifdef CONFIG_FLATMEM /* means !SPARSEMEM */ struct page *node_mem_map;#ifdef CONFIG_PAGE_EXTENSION struct page_ext *node_page_ext;
@@ -867,7 +867,7 @@ typedef struct pglist_data {#define node_present_pages (nid) (NODE_DATA(nid)->node_present_pages)#define node_spanned_pages (nid) (NODE_DATA(nid)->node_spanned_pages) -#ifdef CONFIG_FLAT_NODE_MEM_MAP +#ifdef CONFIG_FLATMEM #define pgdat_page_nr (pgdat, pagenr) ((pgdat)->node_mem_map + (pagenr))#else #define pgdat_page_nr (pgdat, pagenr) pfn_to_page((pgdat)->node_start_pfn + (pagenr))
kernel/crash_core.c +1 -1
@@ -483,7 +483,7 @@ static int __init crash_save_vmcoreinfo_init(void)VMCOREINFO_OFFSET (page, compound_head);VMCOREINFO_OFFSET (pglist_data, node_zones);VMCOREINFO_OFFSET (pglist_data, nr_zones); -#ifdef CONFIG_FLAT_NODE_MEM_MAP +#ifdef CONFIG_FLATMEM VMCOREINFO_OFFSET (pglist_data, node_mem_map);#endif VMCOREINFO_OFFSET (pglist_data, node_start_pfn);
mm/Kconfig +0 -4
@@ -55,10 +55,6 @@ config FLATMEM def_bool y depends on !SPARSEMEM || FLATMEM_MANUAL -config FLAT_NODE_MEM_MAP - def_bool y - depends on !SPARSEMEM - # # SPARSEMEM_EXTREME (which is the default) does some bootmem # allocations when sparse_init() is called. If this cannot
mm/page_alloc.c +3 -3
@@ -6444,7 +6444,7 @@ static void __meminit zone_init_free_lists(struct zone *zone) } } -#if !defined(CONFIG_FLAT_NODE_MEM_MAP ) +#if !defined(CONFIG_FLATMEM )/* * Only struct pages that correspond to ranges defined by memblock.memory * are zeroed and initialized by going through __init_single_page() during
@@ -7241,7 +7241,7 @@ static void __init free_area_init_core(struct pglist_data *pgdat) } } -#ifdef CONFIG_FLAT_NODE_MEM_MAP +#ifdef CONFIG_FLATMEM static void __ref alloc_node_mem_map (struct pglist_data *pgdat) {unsigned long __maybe_unused start =0 ;
@@ -7289,7 +7289,7 @@ static void __ref alloc_node_mem_map(struct pglist_data *pgdat) }#else static void __ref alloc_node_mem_map (struct pglist_data *pgdat) { } -#endif /* CONFIG_FLAT_NODE_MEM_MAP */ +#endif /* CONFIG_FLATMEM */ #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT static inline void pgdat_set_deferred_range (pg_data_t *pgdat)
mm/page_ext.c +1 -1
@@ -191,7 +191,7 @@ void __init page_ext_init_flatmem(void) panic("Out of memory"); } -#else /* CONFIG_FLAT_NODE_MEM_MAP */ +#else /* CONFIG_FLATMEM */ struct page_ext *lookup_page_ext (const struct page *page) {
Signature · 7 lines
2.28.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Andrew Morton
maintainerRe: [PATCH v3 8/9] mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA
In reply to Mike RapoportQuoted 21 lines · On Tue, 8 Jun 2021 12:13:15 +0300 Mike Rapoport <[email protected]> wrote:
From: Mike Rapoport <[email protected]>
After removal of DISCINTIGMEM the
NEED_MULTIPLE_NODESand NUMA configuration options are equivalent.Drop
CONFIG_NEED_MULTIPLE_NODESand useCONFIG_NUMAinstead.Done with
$ sed -i 's/CONFIG_NEED_MULTIPLE_NODES/CONFIG_NUMA/' \ $(git grep -wl CONFIG_NEED_MULTIPLE_NODES) $ sed -i 's/NEED_MULTIPLE_NODES/NUMA/' \ $(git grep -wl NEED_MULTIPLE_NODES)with manual tweaks afterwards.
...
include/linux/mmzone.h extern int movable_zone; · line 993
Quoted 8 lines
include/linux/mmzone.h +1
-1@@ -987,7 +987,7 @@ extern int movable_zone;#ifdef CONFIG_HIGHMEM static inline int zone_movable_is_highmem (void ) { -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA return movable_zone ==ZONE_HIGHMEM ;#else return (ZONE_MOVABLE -1 ) ==ZONE_HIGHMEM ;
I dropped this hunk - your "mm/mmzone.h: simplify is_highmem_idx()" removed zone_movable_is_highmem().
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Mike Rapoport
maintainerRe: [PATCH v3 8/9] mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA
Quoted 20 lines · Andrew Morton
Quoted 18 lines · On Tue, 8 Jun 2021 12:13:15 +0300 Mike Rapoport <[email protected]> wrote:
From: Mike Rapoport <[email protected]>
After removal of DISCINTIGMEM the
NEED_MULTIPLE_NODESand NUMA configuration options are equivalent.Drop
CONFIG_NEED_MULTIPLE_NODESand useCONFIG_NUMAinstead.Done with
$ sed -i 's/CONFIG_NEED_MULTIPLE_NODES/CONFIG_NUMA/' \ $(git grep -wl CONFIG_NEED_MULTIPLE_NODES) $ sed -i 's/NEED_MULTIPLE_NODES/NUMA/' \ $(git grep -wl NEED_MULTIPLE_NODES)with manual tweaks afterwards.
...
Quoted 14 lines
include/linux/mmzone.h extern int movable_zone; · line 993
Quoted 11 lines
include/linux/mmzone.h +1
-1@@ -987,7 +987,7 @@ extern int movable_zone;#ifdef CONFIG_HIGHMEM static inline int zone_movable_is_highmem (void ) { -#ifdef CONFIG_NEED_MULTIPLE_NODES +#ifdef CONFIG_NUMA return movable_zone ==ZONE_HIGHMEM ;#else return (ZONE_MOVABLE -1 ) ==ZONE_HIGHMEM ;I dropped this hunk - your "
mm/mmzone.h: simplifyis_highmem_idx()" removedzone_movable_is_highmem().
Ah, right.
Thanks!
Signature · 7 lines
Sincerely yours, Mike. _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Re: [PATCH v3 5/9] mm: remove CONFIG_DISCONTIGMEM
In reply to Mike RapoportQuoted 20 lines · Mike Rapoport
From: Mike Rapoport <[email protected]>
There are no architectures that support DISCONTIGMEM left.
Remove the configuration option and the dead code it was guarding in the generic memory management code.
Signed-off-by Mike Rapoport <[email protected]>--- include/asm-generic/memory_model.h | 37 ++++-------------------------- include/linux/mmzone.h | 8 ++++--- mm/Kconfig | 25 +++----------------- mm/page_alloc.c | 13 ----------- 4 files changed, 12 insertions(+), 71 deletions(-)include/asm-generic/memory_model.h +0
-0
include/asm-generic/memory_model.h line 11
Quoted 6 lines
include/asm-generic/memory_model.h +3
-0@@ -6,47 +6,18 @@#ifndef __ASSEMBLY__ +/* +* supports 3 memory models. +*/
This comment could either be updated to reflect 2 memory models, or removed entirely.
Thanks,
Stephen
Quoted 163 lines
include/asm-generic/memory_model.h +1
-33#if defined(CONFIG_FLATMEM )#ifndef ARCH_PFN_OFFSET #define ARCH_PFN_OFFSET (0UL)#endif -#elif defined(CONFIG_DISCONTIGMEM ) - -#ifndef arch_pfn_to_nid -#define arch_pfn_to_nid (pfn) pfn_to_nid(pfn) -#endif - -#ifndef arch_local_page_offset -#define arch_local_page_offset (pfn, nid) \ - ((pfn) - NODE_DATA(nid)->node_start_pfn) -#endif - -#endif /* CONFIG_DISCONTIGMEM */ - -/* -* supports 3 memory models. -*/ -#if defined(CONFIG_FLATMEM ) -#define __pfn_to_page (pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET))#define __page_to_pfn (page) ((unsigned long)((page) - mem_map) + \ ARCH_PFN_OFFSET) -#elif defined(CONFIG_DISCONTIGMEM ) - -#define __pfn_to_page (pfn) \ -({ unsigned long __pfn = (pfn); \ - unsigned long __nid = arch_pfn_to_nid(__pfn); \ - NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ -}) - -#define __page_to_pfn (pg) \ -({ const struct page *__pg = (pg); \ - struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ - (unsigned long)(__pg - __pgdat->node_mem_map) + \ - __pgdat->node_start_pfn; \ -})#elif defined(CONFIG_SPARSEMEM_VMEMMAP )@@ -70,7 +41,7 @@struct mem_section *__sec =__pfn_to_section (__pfn); \__section_mem_map_addr (__sec) + __pfn; \ }) -#endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ +#endif /* CONFIG_FLATMEM/SPARSEMEM */ /* * Convert a physical address to a Page Frame Number and back include/linux/mmzone.h +5
-3@@ -738,10 +738,12 @@ struct zonelist {struct zoneref _zonerefs[MAX_ZONES_PER_ZONELIST +1 ]; }; -#ifndef CONFIG_DISCONTIGMEM -/* The array of struct pages - for discontigmem use pgdat->lmem_map */ +/* +* The array of struct pages for flatmem. +* It must be declared for SPARSEMEM as well because there are configurations +* that rely on that. +*/ extern struct page *mem_map; -#endif #ifdef CONFIG_TRANSPARENT_HUGEPAGE struct deferred_split {mm/Kconfig +3
-22@@ -19,7 +19,7 @@ choice config FLATMEM_MANUAL bool "Flat Memory" - depends on !(ARCH_DISCONTIGMEM_ENABLE || ARCH_SPARSEMEM_ENABLE) || ARCH_FLATMEM_ENABLE + depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE help This option is best suited for non-NUMA systems with flat address space. The FLATMEM is the most efficient@@ -32,21 +32,6 @@ config FLATMEM_MANUAL If unsure, choose this option (Flat Memory) over any other. -config DISCONTIGMEM_MANUAL - bool "Discontiguous Memory" - depends on ARCH_DISCONTIGMEM_ENABLE - help - This option provides enhanced support for discontiguous - memory systems, over FLATMEM. These systems have holes - in their physical address spaces, and this option provides - more efficient handling of these holes. - - Although "Discontiguous Memory" is still used by several - architectures, it is considered deprecated in favor of - "Sparse Memory". - - If unsure, choose "Sparse Memory" over this option. - config SPARSEMEM_MANUAL bool "Sparse Memory" depends on ARCH_SPARSEMEM_ENABLE@@ -62,17 +47,13 @@ config SPARSEMEM_MANUAL endchoice -config DISCONTIGMEM - def_bool y - depends on (!SELECT_MEMORY_MODEL && ARCH_DISCONTIGMEM_ENABLE) || DISCONTIGMEM_MANUAL - config SPARSEMEM def_bool y depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL config FLATMEM def_bool y - depends on (!DISCONTIGMEM && !SPARSEMEM) || FLATMEM_MANUAL + depends on !SPARSEMEM || FLATMEM_MANUAL config FLAT_NODE_MEM_MAP def_bool y@@ -85,7 +66,7 @@ config FLAT_NODE_MEM_MAP # config NEED_MULTIPLE_NODES def_bool y - depends on DISCONTIGMEM || NUMA + depends on NUMA # # SPARSEMEM_EXTREME (which is the default) does some bootmemmm/page_alloc.c +0
-13@@ -331,20 +331,7 @@ compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS] = {int min_free_kbytes =1024 ;int user_min_free_kbytes =-1 ; -#ifdef CONFIG_DISCONTIGMEM -/* -* DiscontigMem defines memory ranges as separate pg_data_t even if the ranges -* are not on separate NUMA nodes. Functionally this works but with -* watermark_boost_factor, it can reclaim prematurely as the ranges can be -* quite small. By default, do not boost watermarks on discontigmem as in -* many cases very high-order allocations like THP are likely to be -* unsupported and the premature reclaim offsets the advantage of long-term -* fragmentation avoidance. -*/ -int watermark_boost_factor__read_mostly ; -#else int watermark_boost_factor__read_mostly =15000 ; -#endif int watermark_scale_factor =10 ;static unsigned long nr_kernel_pages__initdata ;Signature · 1 line
2.28.0
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Mike Rapoport
maintainerRe: [PATCH v3 5/9] mm: remove CONFIG_DISCONTIGMEM
Quoted 22 lines · Stephen Brennan
Quoted 21 lines · Mike Rapoport
From: Mike Rapoport <[email protected]>
There are no architectures that support DISCONTIGMEM left.
Remove the configuration option and the dead code it was guarding in the generic memory management code.
Signed-off-by Mike Rapoport <[email protected]>--- include/asm-generic/memory_model.h | 37 ++++-------------------------- include/linux/mmzone.h | 8 ++++--- mm/Kconfig | 25 +++----------------- mm/page_alloc.c | 13 ----------- 4 files changed, 12 insertions(+), 71 deletions(-)include/asm-generic/memory_model.h +0
-0@@ -6,47 +6,18 @@
Quoted 8 lines
include/asm-generic/memory_model.h line 11
Quoted 5 lines
include/asm-generic/memory_model.h +3
-0#ifndef __ASSEMBLY__ +/* +* supports 3 memory models. +*/ This comment could either be updated to reflect 2 memory models, or removed entirely.
I counted SPARSE and SPARSE_VMEMMAP as 2.
The code below has three clauses: one for FLATMEM, one for SPARSE and one for VMEMMAP.
Quoted 171 lines
Thanks,
StephenQuoted 163 lines
include/asm-generic/memory_model.h +1
-33#if defined(CONFIG_FLATMEM )#ifndef ARCH_PFN_OFFSET #define ARCH_PFN_OFFSET (0UL)#endif -#elif defined(CONFIG_DISCONTIGMEM ) - -#ifndef arch_pfn_to_nid -#define arch_pfn_to_nid (pfn) pfn_to_nid(pfn) -#endif - -#ifndef arch_local_page_offset -#define arch_local_page_offset (pfn, nid) \ - ((pfn) - NODE_DATA(nid)->node_start_pfn) -#endif - -#endif /* CONFIG_DISCONTIGMEM */ - -/* -* supports 3 memory models. -*/ -#if defined(CONFIG_FLATMEM ) -#define __pfn_to_page (pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET))#define __page_to_pfn (page) ((unsigned long)((page) - mem_map) + \ ARCH_PFN_OFFSET) -#elif defined(CONFIG_DISCONTIGMEM ) - -#define __pfn_to_page (pfn) \ -({ unsigned long __pfn = (pfn); \ - unsigned long __nid = arch_pfn_to_nid(__pfn); \ - NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ -}) - -#define __page_to_pfn (pg) \ -({ const struct page *__pg = (pg); \ - struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ - (unsigned long)(__pg - __pgdat->node_mem_map) + \ - __pgdat->node_start_pfn; \ -})#elif defined(CONFIG_SPARSEMEM_VMEMMAP )@@ -70,7 +41,7 @@struct mem_section *__sec =__pfn_to_section (__pfn); \__section_mem_map_addr (__sec) + __pfn; \ }) -#endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ +#endif /* CONFIG_FLATMEM/SPARSEMEM */ /* * Convert a physical address to a Page Frame Number and back include/linux/mmzone.h +5
-3@@ -738,10 +738,12 @@ struct zonelist {struct zoneref _zonerefs[MAX_ZONES_PER_ZONELIST +1 ]; }; -#ifndef CONFIG_DISCONTIGMEM -/* The array of struct pages - for discontigmem use pgdat->lmem_map */ +/* +* The array of struct pages for flatmem. +* It must be declared for SPARSEMEM as well because there are configurations +* that rely on that. +*/ extern struct page *mem_map; -#endif #ifdef CONFIG_TRANSPARENT_HUGEPAGE struct deferred_split {mm/Kconfig +3
-22@@ -19,7 +19,7 @@ choice config FLATMEM_MANUAL bool "Flat Memory" - depends on !(ARCH_DISCONTIGMEM_ENABLE || ARCH_SPARSEMEM_ENABLE) || ARCH_FLATMEM_ENABLE + depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE help This option is best suited for non-NUMA systems with flat address space. The FLATMEM is the most efficient@@ -32,21 +32,6 @@ config FLATMEM_MANUAL If unsure, choose this option (Flat Memory) over any other. -config DISCONTIGMEM_MANUAL - bool "Discontiguous Memory" - depends on ARCH_DISCONTIGMEM_ENABLE - help - This option provides enhanced support for discontiguous - memory systems, over FLATMEM. These systems have holes - in their physical address spaces, and this option provides - more efficient handling of these holes. - - Although "Discontiguous Memory" is still used by several - architectures, it is considered deprecated in favor of - "Sparse Memory". - - If unsure, choose "Sparse Memory" over this option. - config SPARSEMEM_MANUAL bool "Sparse Memory" depends on ARCH_SPARSEMEM_ENABLE@@ -62,17 +47,13 @@ config SPARSEMEM_MANUAL endchoice -config DISCONTIGMEM - def_bool y - depends on (!SELECT_MEMORY_MODEL && ARCH_DISCONTIGMEM_ENABLE) || DISCONTIGMEM_MANUAL - config SPARSEMEM def_bool y depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL config FLATMEM def_bool y - depends on (!DISCONTIGMEM && !SPARSEMEM) || FLATMEM_MANUAL + depends on !SPARSEMEM || FLATMEM_MANUAL config FLAT_NODE_MEM_MAP def_bool y@@ -85,7 +66,7 @@ config FLAT_NODE_MEM_MAP # config NEED_MULTIPLE_NODES def_bool y - depends on DISCONTIGMEM || NUMA + depends on NUMA # # SPARSEMEM_EXTREME (which is the default) does some bootmemmm/page_alloc.c +0
-13@@ -331,20 +331,7 @@ compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS] = {int min_free_kbytes =1024 ;int user_min_free_kbytes =-1 ; -#ifdef CONFIG_DISCONTIGMEM -/* -* DiscontigMem defines memory ranges as separate pg_data_t even if the ranges -* are not on separate NUMA nodes. Functionally this works but with -* watermark_boost_factor, it can reclaim prematurely as the ranges can be -* quite small. By default, do not boost watermarks on discontigmem as in -* many cases very high-order allocations like THP are likely to be -* unsupported and the premature reclaim offsets the advantage of long-term -* fragmentation avoidance. -*/ -int watermark_boost_factor__read_mostly ; -#else int watermark_boost_factor__read_mostly =15000 ; -#endif int watermark_scale_factor =10 ;static unsigned long nr_kernel_pages__initdata ;Signature · 1 line
2.28.0_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Signature · 7 lines
Sincerely yours, Mike. _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec