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

mm/bootmem_info: export register_page_bootmem_memmap

If other mm code wants to use this function for early memmap inialization
(on the platforms that have it), it should be made available properly, not
just unconditionally in mm.h

Make this function available for such cases.

Link: https://lkml.kernel.org/r/20250228182928.2645936-10-fvdl@google.com
Signed-off-by: Frank van der Linden <fvdl@google.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Joao Martins <joao.m.martins@oracle.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Roman Gushchin (Cruise) <roman.gushchin@linux.dev>
Cc: Usama Arif <usamaarif642@gmail.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Yu Zhao <yuzhao@google.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Frank van der Linden and committed by
Andrew Morton
243a75e2 d3cd80c5

+11 -3
+4
arch/powerpc/mm/init_64.c
··· 41 41 #include <linux/libfdt.h> 42 42 #include <linux/memremap.h> 43 43 #include <linux/memory.h> 44 + #include <linux/bootmem_info.h> 44 45 45 46 #include <asm/pgalloc.h> 46 47 #include <asm/page.h> ··· 387 386 } 388 387 389 388 #endif 389 + 390 + #ifdef CONFIG_HAVE_BOOTMEM_INFO_NODE 390 391 void register_page_bootmem_memmap(unsigned long section_nr, 391 392 struct page *start_page, unsigned long size) 392 393 { 393 394 } 395 + #endif /* CONFIG_HAVE_BOOTMEM_INFO_NODE */ 394 396 395 397 #endif /* CONFIG_SPARSEMEM_VMEMMAP */ 396 398
+7
include/linux/bootmem_info.h
··· 18 18 19 19 #ifdef CONFIG_HAVE_BOOTMEM_INFO_NODE 20 20 void __init register_page_bootmem_info_node(struct pglist_data *pgdat); 21 + void register_page_bootmem_memmap(unsigned long section_nr, struct page *map, 22 + unsigned long nr_pages); 21 23 22 24 void get_page_bootmem(unsigned long info, struct page *page, 23 25 enum bootmem_type type); ··· 57 55 } 58 56 #else 59 57 static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) 58 + { 59 + } 60 + 61 + static inline void register_page_bootmem_memmap(unsigned long section_nr, 62 + struct page *map, unsigned long nr_pages) 60 63 { 61 64 } 62 65
-3
include/linux/mm.h
··· 4018 4018 } 4019 4019 #endif 4020 4020 4021 - void register_page_bootmem_memmap(unsigned long section_nr, struct page *map, 4022 - unsigned long nr_pages); 4023 - 4024 4021 enum mf_flags { 4025 4022 MF_COUNT_INCREASED = 1 << 0, 4026 4023 MF_ACTION_REQUIRED = 1 << 1,