]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm: mark early-init static variables with __meminitdata
authorKaitao Cheng <chengkaitao@kylinos.cn>
Sat, 21 Mar 2026 12:08:47 +0000 (20:08 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 5 Apr 2026 20:53:34 +0000 (13:53 -0700)
commitc4a9439a5a372c6c0eb7cd2bc9dbb2494699e98d
tree181aa437367091c01d9b29cfe9b1e39cb2d7126f
parent4fb61d95ad21c3b6f1c09f357ff49d70abb0535e
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>
mm/mm_init.c
mm/sparse-vmemmap.c