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: mark early-init static variables with __meminitdata

Static variables defined inside __meminit functions should also be marked
with __meminitdata, so that their storage is placed in the .init.data
section and reclaimed with free_initmem(), thereby reducing permanent .bss
memory usage when CONFIG_MEMORY_HOTPLUG is disabled.

Link: https://lkml.kernel.org/r/20260321120847.8159-1-pilgrimtao@gmail.com
Signed-off-by: Kaitao Cheng <chengkaitao@kylinos.cn>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Kaitao Cheng and committed by
Andrew Morton
c4a9439a 4fb61d95

+2 -2
+1 -1
mm/mm_init.c
··· 812 812 static bool __meminit 813 813 overlap_memmap_init(unsigned long zone, unsigned long *pfn) 814 814 { 815 - static struct memblock_region *r; 815 + static struct memblock_region *r __meminitdata; 816 816 817 817 if (mirrored_kernelcore && zone == ZONE_MOVABLE) { 818 818 if (!r || *pfn >= memblock_region_memory_end_pfn(r)) {
+1 -1
mm/sparse-vmemmap.c
··· 62 62 if (slab_is_available()) { 63 63 gfp_t gfp_mask = GFP_KERNEL|__GFP_RETRY_MAYFAIL|__GFP_NOWARN; 64 64 int order = get_order(size); 65 - static bool warned; 65 + static bool warned __meminitdata; 66 66 struct page *page; 67 67 68 68 page = alloc_pages_node(node, gfp_mask, order);