mm: Mark early-init static variables with __meminitdata
PATCH 1/1 mm: Mark early-init static variables with __meminitdata
From: Kaitao Cheng <[email protected]>
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.
Signed-off-by Kaitao Cheng <[email protected]>
--- mm/mm_init.c | 2 +- mm/sparse-vmemmap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
mm/mm_init.c +1 -1
@@ -801,7 +801,7 @@ void __meminit reserve_bootmem_region(phys_addr_t start,static bool __meminit overlap_memmap_init (unsigned long zone,unsigned long *pfn) { -static struct memblock_region *r; +static struct memblock_region *r__meminitdata ;if (mirrored_kernelcore && zone ==ZONE_MOVABLE ) {if (!r || *pfn >=memblock_region_memory_end_pfn (r)) {
mm/sparse-vmemmap.c +1 -1
@@ -62,7 +62,7 @@ void * __meminit vmemmap_alloc_block(unsigned long size, int node)if (slab_is_available ()) {gfp_t gfp_mask =GFP_KERNEL |__GFP_RETRY_MAYFAIL|__GFP_NOWARN;int order =get_order (size); -static bool warned; +static bool warned__meminitdata ;struct page *page; page =alloc_pages_node (node, gfp_mask, order);
Signature · 1 line
2.50.1 (Apple Git-155)