UPSTREAM: mm/page_alloc: add some detailed comments in can_steal_fallback

mm/page_alloc: add some detailed comments in can_steal_fallback

[akpm@linux-foundation.org: tweak grammar, fit to 80 cols]
Link: https://lkml.kernel.org/r/20240920122030.159751-1-gxxa03070307@gmail.com
Signed-off-by: gaoxiang17 <gaoxiang17@xiaomi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Bug: 420836317
(cherry picked from commit 6025ea5abbe5d813d6a41c78e6ea14259fb503f4)
Change-Id: Ib4a77bf96edeba6ce2c6627c99aacaf148b07d92
Signed-off-by: yipeng xiang <yipengxiang@honor.corp-partner.google.com>
This commit is contained in:
gaoxiang17
2024-09-20 20:20:30 +08:00
committed by Isaac Manjarres
parent bf5861fc36
commit 4e131ac87c

View File

@@ -2018,6 +2018,14 @@ static bool can_steal_fallback(unsigned int order, int start_mt)
if (order >= pageblock_order) if (order >= pageblock_order)
return true; return true;
/*
* Movable pages won't cause permanent fragmentation, so when you alloc
* small pages, you just need to temporarily steal unmovable or
* reclaimable pages that are closest to the request size. After a
* while, memory compaction may occur to form large contiguous pages,
* and the next movable allocation may not need to steal. Unmovable and
* reclaimable allocations need to actually steal pages.
*/
if (order >= pageblock_order / 2 || if (order >= pageblock_order / 2 ||
start_mt == MIGRATE_RECLAIMABLE || start_mt == MIGRATE_RECLAIMABLE ||
start_mt == MIGRATE_UNMOVABLE || start_mt == MIGRATE_UNMOVABLE ||