Remove DISCINTIGMEM memory model
Subsystems (23)
Mike Rapoport
maintainercover Remove DISCINTIGMEM 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.
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/page.h | 2 +- arch/m68k/include/asm/page_mm.h | 33 ---- 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 | 16 +- 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 +- 66 files changed, 98 insertions(+), 898 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
base-commit: c4681547bcce777daf576925a966ffa824edd09d
Signature · 7 lines
2.28.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Mike Rapoport
maintainerPATCH 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 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 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 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/page.h | 2 +- arch/m68k/include/asm/page_mm.h | 33 --------------------------------- arch/m68k/mm/init.c | 20 -------------------- 4 files changed, 1 insertion(+), 64 deletions(-)
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/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 -33
@@ -126,25 +126,7 @@ 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 +135,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 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 | 4 ++-- mm/Kconfig | 25 +++----------------- mm/memory.c | 3 +-- mm/page_alloc.c | 13 ----------- 5 files changed, 10 insertions(+), 72 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 +2 -2
@@ -738,8 +738,8 @@ struct zonelist {struct zoneref _zonerefs[MAX_ZONES_PER_ZONELIST +1 ]; }; -#ifndef CONFIG_DISCONTIGMEM -/* The array of struct pages - for discontigmem use pgdat->lmem_map */ +#ifdef CONFIG_FLATMEM +/* The array of struct pages for flatmem */ extern struct page *mem_map;#endif
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/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 */ +#ifdef CONFIG_FLATMEM unsigned long max_mapnr;EXPORT_SYMBOL (max_mapnr);
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 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 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 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/page_alloc.c | 6 +++--- 34 files changed, 58 insertions(+), 67 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
@@ -985,7 +985,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 ;
@@ -1041,17 +1041,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/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 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
@@ -775,7 +775,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;
@@ -865,7 +865,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
Re: [PATCH 4/9] m68k: remove support for DISCONTIGMEM
In reply to Mike RapoportHi Mike,
Quoted 8 lines · Mike Rapoport
From: 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.
Signed-off-by Mike Rapoport <[email protected]>
Thanks for your patch!
arch/m68k/include/asm/page_mm.h static inline void *__va(unsigned long x) · line 129
Quoted 8 lines
arch/m68k/include/asm/page_mm.h +0
-1@@ -126,25 +126,7 @@ 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])
With pg_data_map[] removed, this definition can go as well. Seems to be a leftover from 1008a11590b966b4 ("m68k: switch to MEMBLOCK
+ NO_BOOTMEM")
There are a few more:
arch/m68k/include/asm/mmzone.h:extern pg_data_t pg_data_map[]; arch/m68k/include/asm/mmzone.h:#define NODE_DATA(nid) (&pg_data_map[nid])
Quoted 22 lines
arch/m68k/include/asm/page_mm.h +0
-17-#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 arch/m68k/mm/init.c +0
-0@@ -44,28 +44,8 @@ EXPORT_SYMBOL(empty_zero_page);
arch/m68k/mm/init.c EXPORT_SYMBOL(empty_zero_page); · line 54
Quoted 10 lines
arch/m68k/mm/init.c +0
-8int 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 -
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Mike Rapoport
maintainerRe: [PATCH 4/9] m68k: remove support for DISCONTIGMEM
Quoted 30 lines · Geert Uytterhoeven
Hi Mike,
Quoted 8 lines · Mike Rapoport
From: 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.
Signed-off-by Mike Rapoport <[email protected]>Thanks for your patch!
Reviewed-by Geert Uytterhoeven <[email protected]>arch/m68k/include/asm/page_mm.h static inline void *__va(unsigned long x) · line 129
Quoted 8 lines
arch/m68k/include/asm/page_mm.h +0
-1@@ -126,25 +126,7 @@ 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])With pg_data_map[] removed, this definition can go as well. Seems to be a leftover from
1008a11590b966b4("m68k: switch to MEMBLOCK
+NO_BOOTMEM")
Quoted 4 lines
There are a few more:
arch/m68k/include/asm/mmzone.h:externpg_data_tpg_data_map[]; arch/m68k/include/asm/mmzone.h:#defineNODE_DATA(nid)(&pg_data_map[nid])
It seems that arch/m68k/include/asm/mmzone.h can be simply removed.
Quoted 44 lines
Quoted 22 lines
arch/m68k/include/asm/page_mm.h +0
-17-#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 arch/m68k/mm/init.c +0
-0@@ -44,28 +44,8 @@ EXPORT_SYMBOL(empty_zero_page);arch/m68k/mm/init.c EXPORT_SYMBOL(empty_zero_page); · line 54
Quoted 10 lines
arch/m68k/mm/init.c +0
-8int 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 -Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Signature · 7 lines
Sincerely yours, Mike. _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
kernel test robot
build botRe: [PATCH 5/9] mm: remove CONFIG_DISCONTIGMEM
In reply to Mike RapoportI love your patch! Yet something to improve:
Hi Mike,
I love your patch! Yet something to improve:
[auto build test ERROR on c4681547bcce777daf576925a966ffa824edd09d]
url: https://github.com/0day-ci/linux/commits/Mike-Rapoport/Remove-DISCINTIGMEM-memory-model/20210602-185609 base: c4681547bcce777daf576925a966ffa824edd09d config: s390-randconfig-r025-20210602 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project db26cd30b6dd65e88d786e97a1e453af5cd48966)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://github.com/0day-ci/linux/commit/1800f1972bb2ae7c788d1f0f1a8a301cf3f3f86c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Mike-Rapoport/Remove-DISCINTIGMEM-memory-model/20210602-185609 git checkout 1800f1972bb2ae7c788d1f0f1a8a301cf3f3f86c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
>> kernel/crash_core.c:459:20: error: use of undeclared identifier 'mem_map'
VMCOREINFO_SYMBOL(mem_map);
^1 error generated.
vim +/mem_map +459 kernel/crash_core.c
0935288c6e008c Vijay Balakrishna 2020-08-11 427
692f66f26a4c19 Hari Bathini 2017-05-08 428 static int __init crash_save_vmcoreinfo_init(void)
692f66f26a4c19 Hari Bathini 2017-05-08 429 {
203e9e41219b4e Xunlei Pang 2017-07-12 430 vmcoreinfo_data = (unsigned char *)get_zeroed_page(GFP_KERNEL);
203e9e41219b4e Xunlei Pang 2017-07-12 431 if (!vmcoreinfo_data) {
203e9e41219b4e Xunlei Pang 2017-07-12 432 pr_warn("Memory allocation for vmcoreinfo_data failed\n");
203e9e41219b4e Xunlei Pang 2017-07-12 433 return -ENOMEM;
203e9e41219b4e Xunlei Pang 2017-07-12 434 }
203e9e41219b4e Xunlei Pang 2017-07-12 435
203e9e41219b4e Xunlei Pang 2017-07-12 436 vmcoreinfo_note = alloc_pages_exact(VMCOREINFO_NOTE_SIZE,
203e9e41219b4e Xunlei Pang 2017-07-12 437 GFP_KERNEL | __GFP_ZERO);
203e9e41219b4e Xunlei Pang 2017-07-12 438 if (!vmcoreinfo_note) {
203e9e41219b4e Xunlei Pang 2017-07-12 439 free_page((unsigned long)vmcoreinfo_data);
203e9e41219b4e Xunlei Pang 2017-07-12 440 vmcoreinfo_data = NULL;
203e9e41219b4e Xunlei Pang 2017-07-12 441 pr_warn("Memory allocation for vmcoreinfo_note failed\n");
203e9e41219b4e Xunlei Pang 2017-07-12 442 return -ENOMEM;
203e9e41219b4e Xunlei Pang 2017-07-12 443 }
203e9e41219b4e Xunlei Pang 2017-07-12 444
692f66f26a4c19 Hari Bathini 2017-05-08 445 VMCOREINFO_OSRELEASE(init_uts_ns.name.release);
0935288c6e008c Vijay Balakrishna 2020-08-11 446 add_build_id_vmcoreinfo();
692f66f26a4c19 Hari Bathini 2017-05-08 447 VMCOREINFO_PAGESIZE(PAGE_SIZE);
692f66f26a4c19 Hari Bathini 2017-05-08 448
692f66f26a4c19 Hari Bathini 2017-05-08 449 VMCOREINFO_SYMBOL(init_uts_ns);
ca4a9241cc5e71 Alexander Egorenkov 2020-12-15 450 VMCOREINFO_OFFSET(uts_namespace, name);
692f66f26a4c19 Hari Bathini 2017-05-08 451 VMCOREINFO_SYMBOL(node_online_map);
692f66f26a4c19 Hari Bathini 2017-05-08 452 #ifdef CONFIG_MMU
eff4345e7fba0a Omar Sandoval 2018-08-21 453 VMCOREINFO_SYMBOL_ARRAY(swapper_pg_dir);
692f66f26a4c19 Hari Bathini 2017-05-08 454 #endif
692f66f26a4c19 Hari Bathini 2017-05-08 455 VMCOREINFO_SYMBOL(_stext);
692f66f26a4c19 Hari Bathini 2017-05-08 456 VMCOREINFO_SYMBOL(vmap_area_list);
692f66f26a4c19 Hari Bathini 2017-05-08 457
692f66f26a4c19 Hari Bathini 2017-05-08 458 #ifndef CONFIG_NEED_MULTIPLE_NODES
692f66f26a4c19 Hari Bathini 2017-05-08 @459 VMCOREINFO_SYMBOL(mem_map);
692f66f26a4c19 Hari Bathini 2017-05-08 460 VMCOREINFO_SYMBOL(contig_page_data);
692f66f26a4c19 Hari Bathini 2017-05-08 461 #endif
692f66f26a4c19 Hari Bathini 2017-05-08 462 #ifdef CONFIG_SPARSEMEM
a0b1280368d1e9 Kirill A. Shutemov 2018-01-12 463 VMCOREINFO_SYMBOL_ARRAY(mem_section);
692f66f26a4c19 Hari Bathini 2017-05-08 464 VMCOREINFO_LENGTH(mem_section, NR_SECTION_ROOTS);
692f66f26a4c19 Hari Bathini 2017-05-08 465 VMCOREINFO_STRUCT_SIZE(mem_section);
692f66f26a4c19 Hari Bathini 2017-05-08 466 VMCOREINFO_OFFSET(mem_section, section_mem_map);
1d50e5d0c50524 Bhupesh Sharma 2020-05-14 467 VMCOREINFO_NUMBER(MAX_PHYSMEM_BITS);
692f66f26a4c19 Hari Bathini 2017-05-08 468 #endif
692f66f26a4c19 Hari Bathini 2017-05-08 469 VMCOREINFO_STRUCT_SIZE(page);
692f66f26a4c19 Hari Bathini 2017-05-08 470 VMCOREINFO_STRUCT_SIZE(pglist_data);
692f66f26a4c19 Hari Bathini 2017-05-08 471 VMCOREINFO_STRUCT_SIZE(zone);
692f66f26a4c19 Hari Bathini 2017-05-08 472 VMCOREINFO_STRUCT_SIZE(free_area);
692f66f26a4c19 Hari Bathini 2017-05-08 473 VMCOREINFO_STRUCT_SIZE(list_head);
692f66f26a4c19 Hari Bathini 2017-05-08 474 VMCOREINFO_SIZE(nodemask_t);
692f66f26a4c19 Hari Bathini 2017-05-08 475 VMCOREINFO_OFFSET(page, flags);
692f66f26a4c19 Hari Bathini 2017-05-08 476 VMCOREINFO_OFFSET(page, _refcount);
692f66f26a4c19 Hari Bathini 2017-05-08 477 VMCOREINFO_OFFSET(page, mapping);
692f66f26a4c19 Hari Bathini 2017-05-08 478 VMCOREINFO_OFFSET(page, lru);
692f66f26a4c19 Hari Bathini 2017-05-08 479 VMCOREINFO_OFFSET(page, _mapcount);
692f66f26a4c19 Hari Bathini 2017-05-08 480 VMCOREINFO_OFFSET(page, private);
692f66f26a4c19 Hari Bathini 2017-05-08 481 VMCOREINFO_OFFSET(page, compound_dtor);
692f66f26a4c19 Hari Bathini 2017-05-08 482 VMCOREINFO_OFFSET(page, compound_order);
692f66f26a4c19 Hari Bathini 2017-05-08 483 VMCOREINFO_OFFSET(page, compound_head);
692f66f26a4c19 Hari Bathini 2017-05-08 484 VMCOREINFO_OFFSET(pglist_data, node_zones);
692f66f26a4c19 Hari Bathini 2017-05-08 485 VMCOREINFO_OFFSET(pglist_data, nr_zones);
692f66f26a4c19 Hari Bathini 2017-05-08 486 #ifdef CONFIG_FLAT_NODE_MEM_MAP
692f66f26a4c19 Hari Bathini 2017-05-08 487 VMCOREINFO_OFFSET(pglist_data, node_mem_map);
692f66f26a4c19 Hari Bathini 2017-05-08 488 #endif
692f66f26a4c19 Hari Bathini 2017-05-08 489 VMCOREINFO_OFFSET(pglist_data, node_start_pfn);
692f66f26a4c19 Hari Bathini 2017-05-08 490 VMCOREINFO_OFFSET(pglist_data, node_spanned_pages);
692f66f26a4c19 Hari Bathini 2017-05-08 491 VMCOREINFO_OFFSET(pglist_data, node_id);
692f66f26a4c19 Hari Bathini 2017-05-08 492 VMCOREINFO_OFFSET(zone, free_area);
692f66f26a4c19 Hari Bathini 2017-05-08 493 VMCOREINFO_OFFSET(zone, vm_stat);
692f66f26a4c19 Hari Bathini 2017-05-08 494 VMCOREINFO_OFFSET(zone, spanned_pages);
692f66f26a4c19 Hari Bathini 2017-05-08 495 VMCOREINFO_OFFSET(free_area, free_list);
692f66f26a4c19 Hari Bathini 2017-05-08 496 VMCOREINFO_OFFSET(list_head, next);
692f66f26a4c19 Hari Bathini 2017-05-08 497 VMCOREINFO_OFFSET(list_head, prev);
692f66f26a4c19 Hari Bathini 2017-05-08 498 VMCOREINFO_OFFSET(vmap_area, va_start);
692f66f26a4c19 Hari Bathini 2017-05-08 499 VMCOREINFO_OFFSET(vmap_area, list);
692f66f26a4c19 Hari Bathini 2017-05-08 500 VMCOREINFO_LENGTH(zone.free_area, MAX_ORDER);
692f66f26a4c19 Hari Bathini 2017-05-08 501 log_buf_vmcoreinfo_setup();
692f66f26a4c19 Hari Bathini 2017-05-08 502 VMCOREINFO_LENGTH(free_area.free_list, MIGRATE_TYPES);
692f66f26a4c19 Hari Bathini 2017-05-08 503 VMCOREINFO_NUMBER(NR_FREE_PAGES);
692f66f26a4c19 Hari Bathini 2017-05-08 504 VMCOREINFO_NUMBER(PG_lru);
692f66f26a4c19 Hari Bathini 2017-05-08 505 VMCOREINFO_NUMBER(PG_private);
692f66f26a4c19 Hari Bathini 2017-05-08 506 VMCOREINFO_NUMBER(PG_swapcache);
1cbf29da3628b6 Petr Tesarik 2018-04-13 507 VMCOREINFO_NUMBER(PG_swapbacked);
692f66f26a4c19 Hari Bathini 2017-05-08 508 VMCOREINFO_NUMBER(PG_slab);
692f66f26a4c19 Hari Bathini 2017-05-08 509 #ifdef CONFIG_MEMORY_FAILURE
692f66f26a4c19 Hari Bathini 2017-05-08 510 VMCOREINFO_NUMBER(PG_hwpoison);
692f66f26a4c19 Hari Bathini 2017-05-08 511 #endif
692f66f26a4c19 Hari Bathini 2017-05-08 512 VMCOREINFO_NUMBER(PG_head_mask);
6e292b9be7f435 Matthew Wilcox 2018-06-07 513 #define PAGE_BUDDY_MAPCOUNT_VALUE (~PG_buddy)
692f66f26a4c19 Hari Bathini 2017-05-08 514 VMCOREINFO_NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE);
692f66f26a4c19 Hari Bathini 2017-05-08 515 #ifdef CONFIG_HUGETLB_PAGE
692f66f26a4c19 Hari Bathini 2017-05-08 516 VMCOREINFO_NUMBER(HUGETLB_PAGE_DTOR);
e04b742f74c236 David Hildenbrand 2019-03-05 517 #define PAGE_OFFLINE_MAPCOUNT_VALUE (~PG_offline)
e04b742f74c236 David Hildenbrand 2019-03-05 518 VMCOREINFO_NUMBER(PAGE_OFFLINE_MAPCOUNT_VALUE);
692f66f26a4c19 Hari Bathini 2017-05-08 519 #endif
692f66f26a4c19 Hari Bathini 2017-05-08 520
692f66f26a4c19 Hari Bathini 2017-05-08 521 arch_crash_save_vmcoreinfo();
692f66f26a4c19 Hari Bathini 2017-05-08 522 update_vmcoreinfo_note();
692f66f26a4c19 Hari Bathini 2017-05-08 523
692f66f26a4c19 Hari Bathini 2017-05-08 524 return 0;
692f66f26a4c19 Hari Bathini 2017-05-08 525 }
692f66f26a4c19 Hari Bathini 2017-05-08 526 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botRe: [PATCH 5/9] mm: remove CONFIG_DISCONTIGMEM
In reply to Mike RapoportI love your patch! Yet something to improve:
Hi Mike,
I love your patch! Yet something to improve:
[auto build test ERROR on c4681547bcce777daf576925a966ffa824edd09d]
url: https://github.com/0day-ci/linux/commits/Mike-Rapoport/Remove-DISCINTIGMEM-memory-model/20210602-185609 base: c4681547bcce777daf576925a966ffa824edd09d config: x86_64-randconfig-a002-20210602 (attached as .config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce (this is a W=1 build): # https://github.com/0day-ci/linux/commit/1800f1972bb2ae7c788d1f0f1a8a301cf3f3f86c git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Mike-Rapoport/Remove-DISCINTIGMEM-memory-model/20210602-185609 git checkout 1800f1972bb2ae7c788d1f0f1a8a301cf3f3f86c # save the attached .config to linux build tree make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
In file included from kernel/crash_core.c:7:
kernel/crash_core.c: In function 'crash_save_vmcoreinfo_init':
>> kernel/crash_core.c:459:20: error: 'mem_map' undeclared (first use in this function); did you mean 'memcmp'?
459 | VMCOREINFO_SYMBOL(mem_map);
| ^~~~~~~
include/linux/crash_core.h:46:67: note: in definition of macro 'VMCOREINFO_SYMBOL'
46 | vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name)
| ^~~~
kernel/crash_core.c:459:20: note: each undeclared identifier is reported only once for each function it appears in
459 | VMCOREINFO_SYMBOL(mem_map);
| ^~~~~~~
include/linux/crash_core.h:46:67: note: in definition of macro 'VMCOREINFO_SYMBOL'
46 | vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name)
| ^~~~vim +459 kernel/crash_core.c
0935288c6e008c Vijay Balakrishna 2020-08-11 427
692f66f26a4c19 Hari Bathini 2017-05-08 428 static int __init crash_save_vmcoreinfo_init(void)
692f66f26a4c19 Hari Bathini 2017-05-08 429 {
203e9e41219b4e Xunlei Pang 2017-07-12 430 vmcoreinfo_data = (unsigned char *)get_zeroed_page(GFP_KERNEL);
203e9e41219b4e Xunlei Pang 2017-07-12 431 if (!vmcoreinfo_data) {
203e9e41219b4e Xunlei Pang 2017-07-12 432 pr_warn("Memory allocation for vmcoreinfo_data failed\n");
203e9e41219b4e Xunlei Pang 2017-07-12 433 return -ENOMEM;
203e9e41219b4e Xunlei Pang 2017-07-12 434 }
203e9e41219b4e Xunlei Pang 2017-07-12 435
203e9e41219b4e Xunlei Pang 2017-07-12 436 vmcoreinfo_note = alloc_pages_exact(VMCOREINFO_NOTE_SIZE,
203e9e41219b4e Xunlei Pang 2017-07-12 437 GFP_KERNEL | __GFP_ZERO);
203e9e41219b4e Xunlei Pang 2017-07-12 438 if (!vmcoreinfo_note) {
203e9e41219b4e Xunlei Pang 2017-07-12 439 free_page((unsigned long)vmcoreinfo_data);
203e9e41219b4e Xunlei Pang 2017-07-12 440 vmcoreinfo_data = NULL;
203e9e41219b4e Xunlei Pang 2017-07-12 441 pr_warn("Memory allocation for vmcoreinfo_note failed\n");
203e9e41219b4e Xunlei Pang 2017-07-12 442 return -ENOMEM;
203e9e41219b4e Xunlei Pang 2017-07-12 443 }
203e9e41219b4e Xunlei Pang 2017-07-12 444
692f66f26a4c19 Hari Bathini 2017-05-08 445 VMCOREINFO_OSRELEASE(init_uts_ns.name.release);
0935288c6e008c Vijay Balakrishna 2020-08-11 446 add_build_id_vmcoreinfo();
692f66f26a4c19 Hari Bathini 2017-05-08 447 VMCOREINFO_PAGESIZE(PAGE_SIZE);
692f66f26a4c19 Hari Bathini 2017-05-08 448
692f66f26a4c19 Hari Bathini 2017-05-08 449 VMCOREINFO_SYMBOL(init_uts_ns);
ca4a9241cc5e71 Alexander Egorenkov 2020-12-15 450 VMCOREINFO_OFFSET(uts_namespace, name);
692f66f26a4c19 Hari Bathini 2017-05-08 451 VMCOREINFO_SYMBOL(node_online_map);
692f66f26a4c19 Hari Bathini 2017-05-08 452 #ifdef CONFIG_MMU
eff4345e7fba0a Omar Sandoval 2018-08-21 453 VMCOREINFO_SYMBOL_ARRAY(swapper_pg_dir);
692f66f26a4c19 Hari Bathini 2017-05-08 454 #endif
692f66f26a4c19 Hari Bathini 2017-05-08 455 VMCOREINFO_SYMBOL(_stext);
692f66f26a4c19 Hari Bathini 2017-05-08 456 VMCOREINFO_SYMBOL(vmap_area_list);
692f66f26a4c19 Hari Bathini 2017-05-08 457
692f66f26a4c19 Hari Bathini 2017-05-08 458 #ifndef CONFIG_NEED_MULTIPLE_NODES
692f66f26a4c19 Hari Bathini 2017-05-08 @459 VMCOREINFO_SYMBOL(mem_map);
692f66f26a4c19 Hari Bathini 2017-05-08 460 VMCOREINFO_SYMBOL(contig_page_data);
692f66f26a4c19 Hari Bathini 2017-05-08 461 #endif
692f66f26a4c19 Hari Bathini 2017-05-08 462 #ifdef CONFIG_SPARSEMEM
a0b1280368d1e9 Kirill A. Shutemov 2018-01-12 463 VMCOREINFO_SYMBOL_ARRAY(mem_section);
692f66f26a4c19 Hari Bathini 2017-05-08 464 VMCOREINFO_LENGTH(mem_section, NR_SECTION_ROOTS);
692f66f26a4c19 Hari Bathini 2017-05-08 465 VMCOREINFO_STRUCT_SIZE(mem_section);
692f66f26a4c19 Hari Bathini 2017-05-08 466 VMCOREINFO_OFFSET(mem_section, section_mem_map);
1d50e5d0c50524 Bhupesh Sharma 2020-05-14 467 VMCOREINFO_NUMBER(MAX_PHYSMEM_BITS);
692f66f26a4c19 Hari Bathini 2017-05-08 468 #endif
692f66f26a4c19 Hari Bathini 2017-05-08 469 VMCOREINFO_STRUCT_SIZE(page);
692f66f26a4c19 Hari Bathini 2017-05-08 470 VMCOREINFO_STRUCT_SIZE(pglist_data);
692f66f26a4c19 Hari Bathini 2017-05-08 471 VMCOREINFO_STRUCT_SIZE(zone);
692f66f26a4c19 Hari Bathini 2017-05-08 472 VMCOREINFO_STRUCT_SIZE(free_area);
692f66f26a4c19 Hari Bathini 2017-05-08 473 VMCOREINFO_STRUCT_SIZE(list_head);
692f66f26a4c19 Hari Bathini 2017-05-08 474 VMCOREINFO_SIZE(nodemask_t);
692f66f26a4c19 Hari Bathini 2017-05-08 475 VMCOREINFO_OFFSET(page, flags);
692f66f26a4c19 Hari Bathini 2017-05-08 476 VMCOREINFO_OFFSET(page, _refcount);
692f66f26a4c19 Hari Bathini 2017-05-08 477 VMCOREINFO_OFFSET(page, mapping);
692f66f26a4c19 Hari Bathini 2017-05-08 478 VMCOREINFO_OFFSET(page, lru);
692f66f26a4c19 Hari Bathini 2017-05-08 479 VMCOREINFO_OFFSET(page, _mapcount);
692f66f26a4c19 Hari Bathini 2017-05-08 480 VMCOREINFO_OFFSET(page, private);
692f66f26a4c19 Hari Bathini 2017-05-08 481 VMCOREINFO_OFFSET(page, compound_dtor);
692f66f26a4c19 Hari Bathini 2017-05-08 482 VMCOREINFO_OFFSET(page, compound_order);
692f66f26a4c19 Hari Bathini 2017-05-08 483 VMCOREINFO_OFFSET(page, compound_head);
692f66f26a4c19 Hari Bathini 2017-05-08 484 VMCOREINFO_OFFSET(pglist_data, node_zones);
692f66f26a4c19 Hari Bathini 2017-05-08 485 VMCOREINFO_OFFSET(pglist_data, nr_zones);
692f66f26a4c19 Hari Bathini 2017-05-08 486 #ifdef CONFIG_FLAT_NODE_MEM_MAP
692f66f26a4c19 Hari Bathini 2017-05-08 487 VMCOREINFO_OFFSET(pglist_data, node_mem_map);
692f66f26a4c19 Hari Bathini 2017-05-08 488 #endif
692f66f26a4c19 Hari Bathini 2017-05-08 489 VMCOREINFO_OFFSET(pglist_data, node_start_pfn);
692f66f26a4c19 Hari Bathini 2017-05-08 490 VMCOREINFO_OFFSET(pglist_data, node_spanned_pages);
692f66f26a4c19 Hari Bathini 2017-05-08 491 VMCOREINFO_OFFSET(pglist_data, node_id);
692f66f26a4c19 Hari Bathini 2017-05-08 492 VMCOREINFO_OFFSET(zone, free_area);
692f66f26a4c19 Hari Bathini 2017-05-08 493 VMCOREINFO_OFFSET(zone, vm_stat);
692f66f26a4c19 Hari Bathini 2017-05-08 494 VMCOREINFO_OFFSET(zone, spanned_pages);
692f66f26a4c19 Hari Bathini 2017-05-08 495 VMCOREINFO_OFFSET(free_area, free_list);
692f66f26a4c19 Hari Bathini 2017-05-08 496 VMCOREINFO_OFFSET(list_head, next);
692f66f26a4c19 Hari Bathini 2017-05-08 497 VMCOREINFO_OFFSET(list_head, prev);
692f66f26a4c19 Hari Bathini 2017-05-08 498 VMCOREINFO_OFFSET(vmap_area, va_start);
692f66f26a4c19 Hari Bathini 2017-05-08 499 VMCOREINFO_OFFSET(vmap_area, list);
692f66f26a4c19 Hari Bathini 2017-05-08 500 VMCOREINFO_LENGTH(zone.free_area, MAX_ORDER);
692f66f26a4c19 Hari Bathini 2017-05-08 501 log_buf_vmcoreinfo_setup();
692f66f26a4c19 Hari Bathini 2017-05-08 502 VMCOREINFO_LENGTH(free_area.free_list, MIGRATE_TYPES);
692f66f26a4c19 Hari Bathini 2017-05-08 503 VMCOREINFO_NUMBER(NR_FREE_PAGES);
692f66f26a4c19 Hari Bathini 2017-05-08 504 VMCOREINFO_NUMBER(PG_lru);
692f66f26a4c19 Hari Bathini 2017-05-08 505 VMCOREINFO_NUMBER(PG_private);
692f66f26a4c19 Hari Bathini 2017-05-08 506 VMCOREINFO_NUMBER(PG_swapcache);
1cbf29da3628b6 Petr Tesarik 2018-04-13 507 VMCOREINFO_NUMBER(PG_swapbacked);
692f66f26a4c19 Hari Bathini 2017-05-08 508 VMCOREINFO_NUMBER(PG_slab);
692f66f26a4c19 Hari Bathini 2017-05-08 509 #ifdef CONFIG_MEMORY_FAILURE
692f66f26a4c19 Hari Bathini 2017-05-08 510 VMCOREINFO_NUMBER(PG_hwpoison);
692f66f26a4c19 Hari Bathini 2017-05-08 511 #endif
692f66f26a4c19 Hari Bathini 2017-05-08 512 VMCOREINFO_NUMBER(PG_head_mask);
6e292b9be7f435 Matthew Wilcox 2018-06-07 513 #define PAGE_BUDDY_MAPCOUNT_VALUE (~PG_buddy)
692f66f26a4c19 Hari Bathini 2017-05-08 514 VMCOREINFO_NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE);
692f66f26a4c19 Hari Bathini 2017-05-08 515 #ifdef CONFIG_HUGETLB_PAGE
692f66f26a4c19 Hari Bathini 2017-05-08 516 VMCOREINFO_NUMBER(HUGETLB_PAGE_DTOR);
e04b742f74c236 David Hildenbrand 2019-03-05 517 #define PAGE_OFFLINE_MAPCOUNT_VALUE (~PG_offline)
e04b742f74c236 David Hildenbrand 2019-03-05 518 VMCOREINFO_NUMBER(PAGE_OFFLINE_MAPCOUNT_VALUE);
692f66f26a4c19 Hari Bathini 2017-05-08 519 #endif
692f66f26a4c19 Hari Bathini 2017-05-08 520
692f66f26a4c19 Hari Bathini 2017-05-08 521 arch_crash_save_vmcoreinfo();
692f66f26a4c19 Hari Bathini 2017-05-08 522 update_vmcoreinfo_note();
692f66f26a4c19 Hari Bathini 2017-05-08 523
692f66f26a4c19 Hari Bathini 2017-05-08 524 return 0;
692f66f26a4c19 Hari Bathini 2017-05-08 525 }
692f66f26a4c19 Hari Bathini 2017-05-08 526 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botRe: [PATCH 5/9] mm: remove CONFIG_DISCONTIGMEM
In reply to Mike RapoportI love your patch! Yet something to improve:
Hi Mike,
I love your patch! Yet something to improve:
[auto build test ERROR on c4681547bcce777daf576925a966ffa824edd09d]
url: https://github.com/0day-ci/linux/commits/Mike-Rapoport/Remove-DISCINTIGMEM-memory-model/20210602-185609 base: c4681547bcce777daf576925a966ffa824edd09d config: arm-neponset_defconfig (attached as .config) compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/1800f1972bb2ae7c788d1f0f1a8a301cf3f3f86c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Mike-Rapoport/Remove-DISCINTIGMEM-memory-model/20210602-185609 git checkout 1800f1972bb2ae7c788d1f0f1a8a301cf3f3f86c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
arch/arm/mm/init.c:97:13: warning: no previous prototype for 'setup_dma_zone' [-Wmissing-prototypes]
97 | void __init setup_dma_zone(const struct machine_desc *mdesc)
| ^~~~~~~~~~~~~~
arch/arm/mm/init.c: In function 'mem_init':
>> arch/arm/mm/init.c:311:39: error: 'mem_map' undeclared (first use in this function); did you mean 'memunmap'?
311 | set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
| ^~~~~~~
| memunmap arch/arm/mm/init.c:311:39: note: each undeclared identifier is reported only once for each function it appears in
vim +311 arch/arm/mm/init.c
ad3c7b18c5b362 Christoph Hellwig 2019-07-23 310b3ba41f28f7fe1 Santosh Shilimkar 2013-11-23 @311 set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
^1da177e4c3f41 Linus Torvalds 2005-04-16 312 ^1da177e4c3f41 Linus Torvalds 2005-04-16 313 /* this will put all unused low memory onto the freelists */ c6ffc5ca8fb311 Mike Rapoport 2018-10-30 314 memblock_free_all(); ^1da177e4c3f41 Linus Torvalds 2005-04-16 315
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Re: [PATCH 1/9] alpha: remove DISCONTIGMEM and NUMA
In reply to Mike RapoportQuoted 803 lines · Mike Rapoport
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.
Signed-off-by Mike Rapoport <[email protected]>--- 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.hdelete mode 100644arch/alpha/mm/numa.carch/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 boolarch/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@@ -1,100 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* -* Written by Kanoj Sarcar ([email protected]) Aug 99 -* Adapted for the alpha wildfire architecture Jan 2001. -*/ -#ifndef _ASM_MMZONE_H_ -#define _ASM_MMZONE_H_ - -#ifdef CONFIG_DISCONTIGMEM - -#include <asm/smp.h> - -/* -* Following are macros that are specific to this numa platform. -*/ - -extern pg_data_t node_data[]; - -#define alpha_pa_to_nid (pa) \ - (alpha_mv.pa_to_nid \ - ? alpha_mv.pa_to_nid(pa) \ - : (0)) -#define node_mem_start (nid) \ - (alpha_mv.node_mem_start \ - ? alpha_mv.node_mem_start(nid) \ - : (0UL)) -#define node_mem_size (nid) \ - (alpha_mv.node_mem_size \ - ? alpha_mv.node_mem_size(nid) \ - : ((nid) ? (0UL) : (~0UL))) - -#define pa_to_nid (pa) alpha_pa_to_nid(pa) -#define NODE_DATA (nid) (&node_data[(nid)]) - -#define node_localnr (pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn) - -#if 1 -#define PLAT_NODE_DATA_LOCALNR (p, n) \ - (((p) >> PAGE_SHIFT) - PLAT_NODE_DATA(n)->gendata.node_start_pfn) -#else -static inline unsigned long -PLAT_NODE_DATA_LOCALNR (unsigned long p,int n) -{ -unsigned long temp; - temp = p >>PAGE_SHIFT ; -return temp -PLAT_NODE_DATA (n)->gendata.node_start_pfn; -} -#endif - -/* -* Following are macros that each numa implementation must define. -*/ - -/* -* Given a kernel address, find the home node of the underlying memory. -*/ -#define kvaddr_to_nid (kaddr) pa_to_nid(__pa(kaddr)) - -/* -* Given a kaddr, LOCAL_BASE_ADDR finds the owning node of the memory -* and returns the kaddr corresponding to first physical page in the -* node's mem_map. -*/ -#define LOCAL_BASE_ADDR (kaddr) \ - ((unsigned long)__va(NODE_DATA(kvaddr_to_nid(kaddr))->node_start_pfn \ - << PAGE_SHIFT)) - -/* XXX: FIXME -- nyc */ -#define kern_addr_valid (kaddr) (0) - -#define mk_pte (page, pgprot) \ -({ \ - pte_t pte; \ - unsigned long pfn; \ - \ - pfn = page_to_pfn(page) << 32; \ - pte_val(pte) = pfn | pgprot_val(pgprot); \ - \ - pte; \ -}) - -#define pte_page (x) \ -({ \ - unsigned long kvirt; \ - struct page * __xx; \ - \ - kvirt = (unsigned long)__va(pte_val(x) >> (32-PAGE_SHIFT)); \ - __xx = virt_to_page(kvirt); \ - \ - __xx; \ -}) - -#define pfn_to_nid (pfn) pa_to_nid(((u64)(pfn) << PAGE_SHIFT)) -#define pfn_valid (pfn) \ - (((pfn) - node_start_pfn(pfn_to_nid(pfn))) < \ - node_spanned_pages(pfn_to_nid(pfn))) \ - -#endif /* CONFIG_DISCONTIGMEM */ - -#endif /* _ASM_MMZONE_H_ */ 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@@ -287,8 +287,7 @@ io7_init_hose(struct io7 *io7, int port)/* * Set up window 0 for scatter-gather 8MB at 8MB. */ - hose->sg_isa =iommu_arena_new_node (marvel_cpuid_to_nid (io7->pe), - hose,0x00800000 ,0x00800000 ,0 ); + hose->sg_isa =iommu_arena_new_node (0 , hose,0x00800000 ,0x00800000 ,0 ); hose->sg_isa->align_entry =8 ;/* cache line boundary */ csrs->POx_WBASE[0 ].csr = hose->sg_isa->dma_base | wbase_m_ena | wbase_m_sg;@@ -305,8 +304,7 @@ io7_init_hose(struct io7 *io7, int port)/* * Set up window 2 for scatter-gather (up-to) 1GB at 3GB. */ - hose->sg_pci =iommu_arena_new_node (marvel_cpuid_to_nid (io7->pe), - hose,0xc0000000 ,0x40000000 ,0 ); + hose->sg_pci =iommu_arena_new_node (0 , hose,0xc0000000 ,0x40000000 ,0 ); hose->sg_pci->align_entry =8 ;/* cache line boundary */ csrs->POx_WBASE[2 ].csr = hose->sg_pci->dma_base | wbase_m_ena | wbase_m_sg;@@ -843,53 +841,8 @@ EXPORT_SYMBOL(marvel_ioportmap);EXPORT_SYMBOL (marvel_ioread8);EXPORT_SYMBOL (marvel_iowrite8);#endif - -/* -* NUMA Support -*/ -/********** -* FIXME - for now each cpu is a node by itself -* -- no real support for striped mode -********** -*/ -int -marvel_pa_to_nid (unsigned long pa) -{ -int cpuid; -if ((pa >>43 ) &1 )/* I/O */ - cpuid = (~(pa >>35 ) &0xff ); -else /* mem */ - cpuid = ((pa >>34 ) &0x3 ) | ((pa >> (37 -2 )) & (0x1f <<2 )); - -return marvel_cpuid_to_nid (cpuid); -} - -int -marvel_cpuid_to_nid (int cpuid) -{ -return cpuid; -} - -unsigned long -marvel_node_mem_start (int nid) -{ -unsigned long pa; - - pa = (nid &0x3 ) | ((nid & (0x1f <<2 )) <<1 ); - pa <<=34 ; - -return pa; -} - -unsigned long -marvel_node_mem_size (int nid) -{ -return 16UL *1024 *1024 *1024 ;/* 16GB */ -} - - -/* +/* * AGP GART Support. */ #include <linux/agp_backend.h> 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 __initarch/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.oarch/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
-213@@ -1,223 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* -* linux/arch/alpha/mm/numa.c -* -* DISCONTIGMEM NUMA alpha support. -* -* Copyright (C) 2001 Andrea Arcangeli <[email protected]> SuSE -*/ - -#include <linux/types.h> -#include <linux/kernel.h> -#include <linux/mm.h> -#include <linux/memblock.h> -#include <linux/swap.h> -#include <linux/initrd.h> -#include <linux/pfn.h> -#include <linux/module.h> - -#include <asm/hwrpb.h> -#include <asm/sections.h> - -pg_data_t node_data[MAX_NUMNODES ]; -EXPORT_SYMBOL (node_data); - -#undef DEBUG_DISCONTIG -#ifdef DEBUG_DISCONTIG -#define DBGDCONT(args...) printk(args) -#else -#define DBGDCONT(args...) -#endif - -#define for_each_mem_cluster (memdesc, _cluster, i) \ - for ((_cluster) = (memdesc)->cluster, (i) = 0; \ - (i) < (memdesc)->numclusters; (i)++, (_cluster)++) - -static void __init show_mem_layout (void ) -{ -struct memclust_struct * cluster; -struct memdesc_struct * memdesc; -int i; - -/* Find free clusters, and init and free the bootmem accordingly. */ - memdesc = (struct memdesc_struct *) - (hwrpb->mddt_offset + (unsigned long ) hwrpb); - -printk ("Raw memory layout:\n" ); -for_each_mem_cluster (memdesc, cluster, i) { -printk (" memcluster %2d, usage %1lx, start %8lu, end %8lu\n" , - i, cluster->usage, cluster->start_pfn, - cluster->start_pfn + cluster->numpages); - } -} - -static void __init -setup_memory_node (int nid,void *kernel_end) -{ -extern unsigned long mem_size_limit; -struct memclust_struct * cluster; -struct memdesc_struct * memdesc; -unsigned long start_kernel_pfn, end_kernel_pfn; -unsigned long start, end; -unsigned long node_pfn_start, node_pfn_end; -unsigned long node_min_pfn, node_max_pfn; -int i; -int show_init =0 ; - -/* Find the bounds of current node */ - node_pfn_start = (node_mem_start (nid)) >>PAGE_SHIFT ; - node_pfn_end = node_pfn_start + (node_mem_size (nid) >>PAGE_SHIFT ); - -/* Find free clusters, and init and free the bootmem accordingly. */ - memdesc = (struct memdesc_struct *) - (hwrpb->mddt_offset + (unsigned long ) hwrpb); - -/* find the bounds of this node (node_min_pfn/node_max_pfn) */ - node_min_pfn = ~0UL ; - node_max_pfn =0UL ; -for_each_mem_cluster (memdesc, cluster, i) { -/* Bit 0 is console/PALcode reserved. Bit 1 is -non-volatile memory -- we might want to mark -this for later. */ -if (cluster->usage &3 ) -continue ; - - start = cluster->start_pfn; - end = start + cluster->numpages; - -if (start >= node_pfn_end || end <= node_pfn_start) -continue ; - -if (!show_init) { - show_init =1 ; -printk ("Initializing bootmem allocator on Node ID %d\n" , nid); - } -printk (" memcluster %2d, usage %1lx, start %8lu, end %8lu\n" , - i, cluster->usage, cluster->start_pfn, - cluster->start_pfn + cluster->numpages); - -if (start < node_pfn_start) - start = node_pfn_start; -if (end > node_pfn_end) - end = node_pfn_end; - -if (start < node_min_pfn) - node_min_pfn = start; -if (end > node_max_pfn) - node_max_pfn = end; - } - -if (mem_size_limit && node_max_pfn > mem_size_limit) { -static int msg_shown =0 ; -if (!msg_shown) { - msg_shown =1 ; -printk ("setup: forcing memory size to %ldK (from %ldK).\n" , - mem_size_limit << (PAGE_SHIFT -10 ), - node_max_pfn << (PAGE_SHIFT -10 )); - } - node_max_pfn = mem_size_limit; - } - -if (node_min_pfn >= node_max_pfn) -return ; - -/* Update global {min,max}_low_pfn from node information. */ -if (node_min_pfn < min_low_pfn) - min_low_pfn = node_min_pfn; -if (node_max_pfn > max_low_pfn) - max_pfn = max_low_pfn = node_max_pfn; - -#if 0 /* we'll try this one again in a little while */ -/* Cute trick to make sure our local node data is on local memory */ - node_data[nid] = (pg_data_t *)(__va (node_min_pfn <<PAGE_SHIFT )); -#endif -printk (" Detected node memory: start %8lu, end %8lu\n" , - node_min_pfn, node_max_pfn); - -DBGDCONT (" DISCONTIG: node_data[%d] is at 0x%p\n" , nid,NODE_DATA (nid)); - -/* Find the bounds of kernel memory. */ - start_kernel_pfn =PFN_DOWN (KERNEL_START_PHYS ); - end_kernel_pfn =PFN_UP (virt_to_phys (kernel_end)); - -if (!nid && (node_max_pfn < end_kernel_pfn || node_min_pfn > start_kernel_pfn)) -panic ("kernel loaded out of ram" ); - -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 -has much larger alignment than 8Mb, so it's safe. */ - node_min_pfn &= ~((1UL << (MAX_ORDER -1 ))-1 ); - -NODE_DATA (nid)->node_start_pfn = node_min_pfn; -NODE_DATA (nid)->node_present_pages = node_max_pfn - node_min_pfn; - -node_set_online (nid); -} - -void __init -setup_memory (void *kernel_end) -{ -unsigned long kernel_size; -int nid; - -show_mem_layout (); - -nodes_clear (node_online_map); - - min_low_pfn = ~0UL ; - max_low_pfn =0UL ; -for (nid =0 ; nid <MAX_NUMNODES ; nid++) -setup_memory_node (nid, kernel_end); - - kernel_size =virt_to_phys (kernel_end) -KERNEL_START_PHYS ; -memblock_reserve (KERNEL_START_PHYS , kernel_size); - -#ifdef CONFIG_BLK_DEV_INITRD - initrd_start =INITRD_START ; -if (initrd_start) { -extern void *move_initrd (unsigned long ); - - initrd_end = initrd_start+INITRD_SIZE ; -printk ("Initial ramdisk at: 0x%p (%lu bytes)\n" , - (void *) initrd_start,INITRD_SIZE ); - -if ((void *)initrd_end >phys_to_virt (PFN_PHYS (max_low_pfn))) { -if (!move_initrd (PFN_PHYS (max_low_pfn))) -printk ("initrd extends beyond end of memory " -"(0x%08lx > 0x%p)\ndisabling initrd\n" , - initrd_end, -phys_to_virt (PFN_PHYS (max_low_pfn))); - }else { - nid =kvaddr_to_nid (initrd_start); -memblock_reserve (virt_to_phys ((void *)initrd_start), -INITRD_SIZE ); - } - } -#endif /* CONFIG_BLK_DEV_INITRD */ -} - -void __init paging_init (void ) -{ -unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 , }; -unsigned long dma_local_pfn; - -/* -* The old global MAX_DMA_ADDRESS per-arch API doesn't fit -* in the NUMA model, for now we convert it to a pfn and -* we interpret this pfn as a local per-node information. -* This issue isn't very important since none of these machines -* have legacy ISA slots anyways. -*/
arch/alpha/mm/numa.c line 223
Quoted 10 lines
arch/alpha/mm/numa.c deleted +0
-10- dma_local_pfn =virt_to_phys ((char *)MAX_DMA_ADDRESS ) >>PAGE_SHIFT ; - - max_zone_pfn[ZONE_DMA ] = dma_local_pfn; - max_zone_pfn[ZONE_NORMAL ] = max_pfn; - -free_area_init (max_zone_pfn); - -/* Initialize the kernel's ZERO_PGE. */ -memset ((void *)ZERO_PGE ,0 ,PAGE_SIZE ); -}
Signature · 3 lines
Thanks, David / dhildenb
Re: [PATCH 2/9] arc: update comment about HIGHMEM implementation
In reply to Mike RapoportQuoted 27 lines · Mike Rapoport
From: Mike Rapoport <[email protected]>
Arc does not use DISCONTIGMEM to implement high memory, update the comment describing how high memory works to reflect this.
Signed-off-by Mike Rapoport <[email protected]>--- arch/arc/mm/init.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)arch/arc/mm/init.c +1
-5@@ -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.
arch/arc/mm/init.c void __init setup_arch_memory(void) · line 151
Quoted 10 lines
arch/arc/mm/init.c +4
-3-* -* 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 · 3 lines
Thanks, David / dhildenb
Re: [PATCH 3/9] arc: remove support for DISCONTIGMEM
In reply to Mike RapoportQuoted 8 lines · Mike Rapoport
From: 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.
Signed-off-by Mike Rapoport <[email protected]>
Signature · 3 lines
Thanks, David / dhildenb
Re: [PATCH 5/9] mm: remove CONFIG_DISCONTIGMEM
In reply to Mike RapoportQuoted 188 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 | 4 ++-- mm/Kconfig | 25 +++----------------- mm/memory.c | 3 +-- mm/page_alloc.c | 13 ----------- 5 files changed, 10 insertions(+), 72 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 +2
-2@@ -738,8 +738,8 @@ struct zonelist {struct zoneref _zonerefs[MAX_ZONES_PER_ZONELIST +1 ]; }; -#ifndef CONFIG_DISCONTIGMEM -/* The array of struct pages - for discontigmem use pgdat->lmem_map */ +#ifdef CONFIG_FLATMEM +/* The array of struct pages for flatmem */ extern struct page *mem_map;#endif 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/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 */ +#ifdef CONFIG_FLATMEM unsigned long max_mapnr;EXPORT_SYMBOL (max_mapnr);mm/page_alloc.c +0
-7@@ -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
mm/page_alloc.c compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS] = { · line 337
Quoted 10 lines
mm/page_alloc.c +0
-6-* 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 ;
Nice
Signature · 3 lines
Thanks, David / dhildenb
Re: [PATCH 6/9] arch, mm: remove stale mentions of DISCONIGMEM
In reply to Mike RapoportQuoted 123 lines · Mike Rapoport
From: 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.
Signed-off-by Mike Rapoport <[email protected]>--- 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 +0
-0
include/linux/gfp.h static inline int gfp_zonelist(gfp_t flags) · line 501
Quoted 10 lines
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 · 3 lines
Thanks, David / dhildenb
Re: [PATCH 7/9] docs: remove description of DISCONTIGMEM
In reply to Mike RapoportQuoted 91 lines · Mike Rapoport
From: 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.
Signed-off-by Mike Rapoport <[email protected]>--- 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_factorDocumentation/vm/memory-model.rst +2
-36@@ -14,15 +14,11 @@ for the CPU. Then there could be several contiguous ranges at completely distinct addresses. And, don't forget about NUMA, where different memory banks are attached to different CPUs. -Linux abstracts this diversity using one of the three memory models: -FLATMEM, DISCONTIGMEM and SPARSEMEM. Each architecture defines what +Linux abstracts this diversity using one of the two memory models: +FLATMEM and SPARSEMEM. Each architecture defines what memory models it supports, what the default memory model is and whether it is possible to manually override that default. -.. note:: - At time of this writing, DISCONTIGMEM is considered deprecated, - although it is still in use by several architectures. - All the memory models track the status of physical page frames using struct page arranged in one or more arrays.@@ -63,43 +59,6 @@ straightforward: `PFN - ARCH_PFN_OFFSET` is an index to the The `ARCH_PFN_OFFSET` defines the first page frame number for systems with physical memory starting at address different from 0. -DISCONTIGMEM -============ - -The DISCONTIGMEM model treats the physical memory as a collection of -`nodes` similarly to how Linux NUMA support does. For each node Linux -constructs an independent memory management subsystem represented by -`struct pglist_data` (or `pg_data_t` for short). Among other -things, `pg_data_t` holds the `node_mem_map` array that maps -physical pages belonging to that node. The `node_start_pfn` field of -`pg_data_t` is the number of the first page frame belonging to that -node. - -The architecture setup code should call :c:func:`free_area_init_node` for -each node in the system to initialize the `pg_data_t` object and its -`node_mem_map`. - -Every `node_mem_map` behaves exactly as FLATMEM's `mem_map` - -every physical page frame in a node has a `struct page` entry in the -`node_mem_map` array. When DISCONTIGMEM is enabled, a portion of the -`flags` field of the `struct page` encodes the node number of the -node hosting that page. - -The conversion between a PFN and the `struct page` in the -DISCONTIGMEM model became slightly more complex as it has to determine -which node hosts the physical page and which `pg_data_t` object -holds the `struct page`. - -Architectures that support DISCONTIGMEM provide :c:func:`pfn_to_nid` -to convert PFN to the node number. The opposite conversion helper -:c:func:`page_to_nid` is generic as it uses the node number encoded in
Documentation/vm/memory-model.rst straightforward: `PFN - ARCH_PFN_OFFSET` is an index to the · line 64
Quoted 10 lines
Documentation/vm/memory-model.rst +0
-7-page->flags. - -Once the node number is known, the PFN can be used to index -appropriate `node_mem_map` array to access the `struct page` and -the offset of the `struct page` from the `node_mem_map` plus -`node_start_pfn` is the PFN of that page. - SPARSEMEM =========
Signature · 3 lines
Thanks, David / dhildenb
Re: [PATCH 8/9] mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA
In reply to Mike RapoportQuoted 710 lines · Mike Rapoport
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.
Signed-off-by Mike Rapoport <[email protected]>--- 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/page_alloc.c | 6 +++--- 34 files changed, 58 insertions(+), 67 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 yarch/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.oarch/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_SMTarch/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 yarch/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@@ -985,7 +985,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 ;@@ -1041,17 +1041,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 cannotmm/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/page_alloc.c +2
-2@@ -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)
mm/page_alloc.c static void __ref alloc_node_mem_map(struct pglist_data *pgdat) · line 7282
Quoted 8 lines
mm/page_alloc.c +1
-1@@ -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 */
Nice
Signature · 3 lines
Thanks, David / dhildenb
Re: [PATCH 9/9] mm: replace CONFIG_FLAT_NODE_MEM_MAP with CONFIG_FLATMEM
In reply to Mike RapoportQuoted 103 lines · Mike Rapoport
From: Mike Rapoport <[email protected]>
After removal of the DISCONTIGMEM memory model the
FLAT_NODE_MEM_MAPconfiguration option is equivalent to FLATMEM.Drop
CONFIG_FLAT_NODE_MEM_MAPand useCONFIG_FLATMEMinstead.Signed-off-by Mike Rapoport <[email protected]>--- 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@@ -775,7 +775,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;@@ -865,7 +865,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 cannotmm/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 +0
-0
mm/page_ext.c void __init page_ext_init_flatmem(void) · line 197
Quoted 8 lines
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 · 3 lines
Thanks, David / dhildenb