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 Signed-off-by: Shivank Garg --- mm/migrate.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index bfd38e6339cf..1d44c6ce48cd 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2021,7 +2021,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. @@ -2153,7 +2153,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 @@ -2161,7 +2161,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, @@ -2212,9 +2212,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; @@ -2239,9 +2239,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; @@ -2329,7 +2329,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); @@ -2349,7 +2349,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.53.0