* [PATCH] mm/page_alloc: Add some detailed comments in can_steal_fallback
@ 2024-09-20 12:20 Xiang Gao
0 siblings, 0 replies; only message in thread
From: Xiang Gao @ 2024-09-20 12:20 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel, gaoxiang17
From: gaoxiang17 <gaoxiang17@xiaomi.com>
Signed-off-by: gaoxiang17 <gaoxiang17@xiaomi.com>
---
mm/page_alloc.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 0aefae4a26b2..8b0634d1728b 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1818,6 +1818,13 @@ static bool can_steal_fallback(unsigned int order, int start_mt)
if (order >= pageblock_order)
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 compact may occur to form large contiguous
+ * pages, and the next movable allocation may not need to steal. Unmovable and reclaimable
+ * allocation need to actually steal pages.
+ */
if (order >= pageblock_order / 2 ||
start_mt == MIGRATE_RECLAIMABLE ||
start_mt == MIGRATE_UNMOVABLE ||
--
2.34.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-09-20 12:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-20 12:20 [PATCH] mm/page_alloc: Add some detailed comments in can_steal_fallback Xiang Gao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox