Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/bootmem_info: remove handling for !CONFIG_SPARSEMEM_VMEMMAP

It is not immediately obvious that CONFIG_HAVE_BOOTMEM_INFO_NODE is only
selected from CONFIG_MEMORY_HOTREMOVE, which itself depends on
CONFIG_MEMORY_HOTPLUG that ... depends on CONFIG_SPARSEMEM_VMEMMAP.

Let's remove the !CONFIG_SPARSEMEM_VMEMMAP leftovers that are dead code.

Link: https://lkml.kernel.org/r/20260320-sparsemem_cleanups-v2-7-096addc8800d@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Wei Xu <weixugc@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

David Hildenbrand (Arm) and committed by
Andrew Morton
41293414 119c31ca

-37
-37
mm/bootmem_info.c
··· 40 40 } 41 41 } 42 42 43 - #ifndef CONFIG_SPARSEMEM_VMEMMAP 44 - static void __init register_page_bootmem_info_section(unsigned long start_pfn) 45 - { 46 - unsigned long mapsize, section_nr, i; 47 - struct mem_section *ms; 48 - struct page *page, *memmap; 49 - struct mem_section_usage *usage; 50 - 51 - section_nr = pfn_to_section_nr(start_pfn); 52 - ms = __nr_to_section(section_nr); 53 - 54 - /* Get section's memmap address */ 55 - memmap = sparse_decode_mem_map(ms->section_mem_map, section_nr); 56 - 57 - /* 58 - * Get page for the memmap's phys address 59 - * XXX: need more consideration for sparse_vmemmap... 60 - */ 61 - page = virt_to_page(memmap); 62 - mapsize = sizeof(struct page) * PAGES_PER_SECTION; 63 - mapsize = PAGE_ALIGN(mapsize) >> PAGE_SHIFT; 64 - 65 - /* remember memmap's page */ 66 - for (i = 0; i < mapsize; i++, page++) 67 - get_page_bootmem(section_nr, page, SECTION_INFO); 68 - 69 - usage = ms->usage; 70 - page = virt_to_page(usage); 71 - 72 - mapsize = PAGE_ALIGN(mem_section_usage_size()) >> PAGE_SHIFT; 73 - 74 - for (i = 0; i < mapsize; i++, page++) 75 - get_page_bootmem(section_nr, page, MIX_SECTION_INFO); 76 - 77 - } 78 - #else /* CONFIG_SPARSEMEM_VMEMMAP */ 79 43 static void __init register_page_bootmem_info_section(unsigned long start_pfn) 80 44 { 81 45 unsigned long mapsize, section_nr, i; ··· 64 100 for (i = 0; i < mapsize; i++, page++) 65 101 get_page_bootmem(section_nr, page, MIX_SECTION_INFO); 66 102 } 67 - #endif /* !CONFIG_SPARSEMEM_VMEMMAP */ 68 103 69 104 void __init register_page_bootmem_info_node(struct pglist_data *pgdat) 70 105 {