[PATCH RFC 06/11] mm/migrate: rename migrate_pages_batch() to migrate_folios_batch()
From: Shivank Garg
Date: Wed Sep 02 2026 - 07:28:50 EST
migrate_pages_batch() operates on folios and calls the folio-based unmap,
move and undo helpers. Now that movable_ops-based page migration has been
separated out, rename it to migrate_folios_batch().
No functional changes intended.
Suggested-by: Zi Yan <ziy@xxxxxxxxxx>
Signed-off-by: Shivank Garg <shivankg@xxxxxxx>
---
mm/migrate.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/mm/migrate.c b/mm/migrate.c
index 55f352efdf2b..163f13344fd2 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -2003,7 +2003,7 @@ static int migrate_folios_unmap(struct list_head *from,
* always reports success when its fromlist is empty.
* stats->nr_thp_failed should be increased too,
* otherwise stats inconsistency will happen when
- * migrate_pages_batch is called via migrate_pages()
+ * migrate_folios_batch is called via migrate_pages()
* with MIGRATE_SYNC and MIGRATE_ASYNC.
*
* Only check it without removing it from the list.
@@ -2135,7 +2135,7 @@ static int migrate_folios_unmap(struct list_head *from,
}
/*
- * migrate_pages_batch() first unmaps as many folios in the source list as
+ * migrate_folios_batch() first unmaps as many folios in the source list as
* possible, flushes the TLBs, then moves the unmapped folios.
*
* Only MIGRATE_ASYNC may batch multiple folios. Waiting for a lock or bit
@@ -2143,7 +2143,7 @@ static int migrate_folios_unmap(struct list_head *from,
* Therefore, if mode != MIGRATE_ASYNC, the source list must contain at most
* one folio.
*/
-static int migrate_pages_batch(struct list_head *from,
+static int migrate_folios_batch(struct list_head *from,
new_folio_t get_new_folio, free_folio_t put_new_folio,
unsigned long private, enum migrate_mode mode, enum migrate_reason reason,
struct list_head *ret_folios, struct list_head *split_folios,
@@ -2194,9 +2194,9 @@ static int migrate_pages_sync(struct list_head *from, new_folio_t get_new_folio,
memset(&astats, 0, sizeof(astats));
/* Try to migrate in batch with MIGRATE_ASYNC mode firstly */
- rc = migrate_pages_batch(from, get_new_folio, put_new_folio, private, MIGRATE_ASYNC,
- reason, &folios, split_folios, &astats,
- NR_MAX_MIGRATE_ASYNC_RETRY);
+ rc = migrate_folios_batch(from, get_new_folio, put_new_folio, private,
+ MIGRATE_ASYNC, reason, &folios, split_folios, &astats,
+ NR_MAX_MIGRATE_ASYNC_RETRY);
stats->nr_succeeded += astats.nr_succeeded;
stats->nr_thp_succeeded += astats.nr_thp_succeeded;
stats->nr_thp_split += astats.nr_thp_split;
@@ -2221,9 +2221,9 @@ static int migrate_pages_sync(struct list_head *from, new_folio_t get_new_folio,
list_splice_tail_init(&folios, from);
while (!list_empty(from)) {
list_move(from->next, &folios);
- rc = migrate_pages_batch(&folios, get_new_folio, put_new_folio,
- private, mode, reason, ret_folios,
- split_folios, stats, NR_MAX_MIGRATE_SYNC_RETRY);
+ rc = migrate_folios_batch(&folios, get_new_folio, put_new_folio,
+ private, mode, reason, ret_folios, split_folios,
+ stats, NR_MAX_MIGRATE_SYNC_RETRY);
list_splice_tail_init(&folios, ret_folios);
if (rc < 0)
return rc;
@@ -2301,7 +2301,7 @@ int migrate_pages(struct list_head *from, new_folio_t get_new_folio,
else
list_splice_init(from, &folios);
if (mode == MIGRATE_ASYNC)
- rc = migrate_pages_batch(&folios, get_new_folio, put_new_folio,
+ rc = migrate_folios_batch(&folios, get_new_folio, put_new_folio,
private, mode, reason, &ret_folios,
&split_folios, &stats,
NR_MAX_MIGRATE_PAGES_RETRY);
@@ -2321,7 +2321,7 @@ int migrate_pages(struct list_head *from, new_folio_t get_new_folio,
* is counted as 1 failure already. And, we only try to migrate
* with minimal effort, force MIGRATE_ASYNC mode and retry once.
*/
- migrate_pages_batch(&split_folios, get_new_folio,
+ migrate_folios_batch(&split_folios, get_new_folio,
put_new_folio, private, MIGRATE_ASYNC, reason,
&ret_folios, NULL, &stats, 1);
list_splice_tail_init(&split_folios, &ret_folios);
--
2.43.0