[Devel] [PATCH hci-8.2 v2 3/3] mm/memcontrol: say what memcg_numa_isolate_pages() limits

Konstantin Khorenko khorenko at virtuozzo.com
Tue Nov 17 19:24:45 MSK 2026


The comment of memcg_numa_isolate_pages() says it isolates at most
@nr_to_scan pages and returns the number of pages scanned. The loop
stops at @nr_to_scan folios scanned or @nr_to_scan pages isolated,
whichever comes first, and returns the number of folios scanned.

Describe both limits and the return value.

No functional change.

https://virtuozzo.atlassian.net/browse/VSTOR-152197

Feature: mm: interface to migrate memory between NUMA nodes upon userspace request
Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 mm/memcontrol.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 4c3c06cfcf9fc..a67c0bc0ee3d2 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3499,9 +3499,10 @@ static struct folio *memcg_numa_migrate_new_folio(struct folio *old_folio,
 }
 
 /*
- * Isolate at most @nr_to_scan pages from @lruvec for further migration and
- * store them in @dst. Returns the number of pages scanned. Return value of 0
- * means that @lruvec is empty.
+ * Isolate folios from @lruvec into @dst for further migration. Stops once
+ * @nr_to_scan folios are scanned or @nr_to_scan pages are isolated, whichever
+ * comes first. Returns the number of folios scanned. Return value of 0 means
+ * that @lruvec is empty.
  */
 static long memcg_numa_isolate_pages(struct lruvec *lruvec,
 				     struct list_head *src, struct list_head *dst,

-- 
2.43.0



More information about the Devel mailing list