]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm/page_alloc: refactor the initial compaction handling
authorVlastimil Babka <vbabka@suse.cz>
Tue, 6 Jan 2026 11:52:37 +0000 (12:52 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 27 Jan 2026 04:02:23 +0000 (20:02 -0800)
commit53a9b4646f67c95df1775aa5f381cb7f42cae957
treea4e49050251330b0b252fa55839faaae280b5bde
parent66987218154918a6341a3e3eeeee58110a69e0bb
mm/page_alloc: refactor the initial compaction handling

The initial direct compaction done in some cases in
__alloc_pages_slowpath() stands out from the main retry loop of reclaim +
compaction.

We can simplify this by instead skipping the initial reclaim attempt via a
new local variable compact_first, and handle the compact_prority as
necessary to match the original behavior.  No functional change intended.

Link: https://lkml.kernel.org/r/20260106-thp-thisnode-tweak-v3-2-f5d67c21a193@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Suggested-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: David Hildenbrand (Red Hat) <david@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/gfp.h
mm/page_alloc.c