Skip to contentSkip to conversation

mm/page_alloc: Add some detailed comments in can_steal_fallback

PATCH Applied Xiang Gao 1 participant 1 message Sep 20, 2024

Subsystems (2)
lore
Share & tools
lore

Xiang Gao

author
#0 lore raw

PATCH 1/1 mm/page_alloc: Add some detailed comments in can_steal_fallback

From: gaoxiang17 <[email protected]>

---
 mm/page_alloc.c | 7 +++++++
 1 file changed, 7 insertions(+)
mm/page_alloc.c +7 -0
index 0aefae4a26b2..8b0634d1728b 100644
@@ -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 ||
Signature · 1 line
2.34.1