]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm/mm_init: use deferred_init_memmap_chunk() in deferred_grow_zone()
authorMike Rapoport (Microsoft) <rppt@kernel.org>
Mon, 18 Aug 2025 06:46:12 +0000 (09:46 +0300)
committerMike Rapoport (Microsoft) <rppt@kernel.org>
Sun, 14 Sep 2025 05:48:48 +0000 (08:48 +0300)
commit3acb913c9d5bd8dcf61677ccba96d349e7681cf8
tree0cdad6273ce2c9f1a85f9b39522d4d652087f246
parentb320789d6883cc00ac78ce83bccbfe7ed58afcf0
mm/mm_init: use deferred_init_memmap_chunk() in deferred_grow_zone()

deferred_grow_zone() initializes one or more sections in the memory map
if buddy runs out of initialized struct pages when
CONFIG_DEFERRED_STRUCT_PAGE_INIT is enabled.

It loops through memblock regions and initializes and frees pages in
MAX_ORDER_NR_PAGES chunks.

Essentially the same loop is implemented in deferred_init_memmap_chunk(),
the only actual difference is that deferred_init_memmap_chunk() does not
count initialized pages.

Make deferred_init_memmap_chunk() count the initialized pages and return
their number, wrap it with deferred_init_memmap_job() for multithreaded
initialization with padata_do_multithreaded() and replace open-coded
initialization of struct pages in deferred_grow_zone() with a call to
deferred_init_memmap_chunk().

Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
mm/mm_init.c