]> git.ipfire.org Git - thirdparty/linux.git/commit
mm/mm_init: deferred_init_memmap: use a job per zone
authorMike Rapoport (Microsoft) <rppt@kernel.org>
Mon, 18 Aug 2025 06:46:13 +0000 (09:46 +0300)
committerMike Rapoport (Microsoft) <rppt@kernel.org>
Sun, 14 Sep 2025 05:48:55 +0000 (08:48 +0300)
commitf1f86187fd72332ef214716a3c5b71616c0d340e
tree9f39262a0e33926d6399991fc39c1a32d0d4b501
parent3acb913c9d5bd8dcf61677ccba96d349e7681cf8
mm/mm_init: deferred_init_memmap: use a job per zone

deferred_init_memmap() loops over free memory ranges and creates a
padata_mt_job for every free range that intersects with the zone being
initialized.

padata_do_multithreaded() then splits every such range to several chunks
and runs a thread that initializes struct pages in that chunk using
deferred_init_memmap_chunk(). The number of threads is limited by amount of
the CPUs on the node (or 1 for memoryless nodes).

Looping through free memory ranges is then repeated in
deferred_init_memmap_chunk() first to find the first range that should be
initialized and then to traverse the ranges until the end of the chunk is
reached.

Remove the loop over free memory regions in deferred_init_memmap() and pass
the entire zone to padata_do_multithreaded() so that it will be divided to
several chunks by the parallelization code.

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