aboutsummaryrefslogtreecommitdiffstats
path: root/mm/sparse.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <[email protected]>2024-10-05 20:01:16 +0000
committerAndrew Morton <[email protected]>2024-11-07 22:38:07 +0000
commit0386aaa6e9c826bc494169a914e01a86befe6edf (patch)
tree922a50772c178f456047bff907dae74defb5db7e /mm/sparse.c
parentmm: mass constification of folio/page pointers (diff)
downloadkernel-0386aaa6e9c826bc494169a914e01a86befe6edf.tar.gz
kernel-0386aaa6e9c826bc494169a914e01a86befe6edf.zip
bootmem: stop using page->index
Encode the type into the bottom four bits of page->private and the info into the remaining bits. Also turn the bootmem type into a named enum. [[email protected]: bootmem: add bootmem_type stub function] Link: https://lkml.kernel.org/r/[email protected] [[email protected]: fix build with !CONFIG_HAVE_BOOTMEM_INFO_NODE] Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: kernel test robot <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'mm/sparse.c')
-rw-r--r--mm/sparse.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/sparse.c b/mm/sparse.c
index 4cb9793f0b52..13b6624d3562 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -720,19 +720,19 @@ static void depopulate_section_memmap(unsigned long pfn, unsigned long nr_pages,
static void free_map_bootmem(struct page *memmap)
{
unsigned long maps_section_nr, removing_section_nr, i;
- unsigned long magic, nr_pages;
+ unsigned long type, nr_pages;
struct page *page = virt_to_page(memmap);
nr_pages = PAGE_ALIGN(PAGES_PER_SECTION * sizeof(struct page))
>> PAGE_SHIFT;
for (i = 0; i < nr_pages; i++, page++) {
- magic = page->index;
+ type = bootmem_type(page);
- BUG_ON(magic == NODE_INFO);
+ BUG_ON(type == NODE_INFO);
maps_section_nr = pfn_to_section_nr(page_to_pfn(page));
- removing_section_nr = page_private(page);
+ removing_section_nr = bootmem_info(page);
/*
* When this function is called, the removing section is