[PATCH 21/22] mm/khugepaged: base the recommended min_free_kbytes on common memory
From: Gregory Price (Meta)
Date: Sat Nov 14 2026 - 02:12:51 EST
set_recommended_min_free_kbytes() reserves two pageblocks per populated
zone to help THP allocations avoid fragmentation. The reserve serves
ordinary allocations, which use only common memory, so count only the
zones on N_MEMORY_COMMON nodes.
Every node with memory is common, so the recommendation is unchanged.
Signed-off-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
---
mm/khugepaged.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index b4bd29f25c145..fac314b89a234 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -3149,7 +3149,7 @@ void set_recommended_min_free_kbytes(void)
goto update_wmarks;
}
- for_each_populated_zone(zone) {
+ for_each_populated_zone_state(zone, N_MEMORY_COMMON) {
/*
* We don't need to worry about fragmentation of
* ZONE_MOVABLE since it only has movable pages.
--
2.53.1-Meta