Re: [PATCH v2 1/3] mm/migrate: rename page to folio leftovers
From: SJ Park
Date: Wed Jul 01 2026 - 19:54:32 EST
On Wed, 1 Jul 2026 05:17:20 +0000 Shivank Garg <shivankg@xxxxxxx> wrote:
> Rename migrate_folio_undo_src()'s page_was_mapped parameter to was_mapped,
> unmap_and_move_huge_page() to unmap_and_move_hugetlb_folio(), its
> page_was_mapped variable to was_mapped and fix stale "page" wording in its
> comments.
>
> Also fix migrate_folio() kerneldoc to say "folio" instead of "page".
Looks cleaner to me!
>
> Suggested-by: Dev Jain <dev.jain@xxxxxxx>
> Suggested-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
> Signed-off-by: Shivank Garg <shivankg@xxxxxxx>
Reviewed-by: SJ Park <sj@xxxxxxxxxx>
A couple of trivial loud-thinking comments below.
> ---
> mm/migrate.c | 36 +++++++++++++++++-------------------
> 1 file changed, 17 insertions(+), 19 deletions(-)
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index 49e10feeb094..858350ca58b4 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -884,7 +884,7 @@ static int __migrate_folio(struct address_space *mapping, struct folio *dst,
> * @mapping: The address_space containing the folio.
> * @dst: The folio to migrate the data to.
> * @src: The folio containing the current data.
> - * @mode: How to migrate the page.
> + * @mode: How to migrate the folio.
> *
> * Common logic to directly migrate a single LRU folio suitable for
> * folios that do not have private data.
> @@ -1157,13 +1157,10 @@ static void __migrate_folio_extract(struct folio *dst,
> }
>
> /* Restore the source folio to the original state upon failure */
> -static void migrate_folio_undo_src(struct folio *src,
> - int page_was_mapped,
> - struct anon_vma *anon_vma,
> - bool locked,
> - struct list_head *ret)
> +static void migrate_folio_undo_src(struct folio *src, int was_mapped,
> + struct anon_vma *anon_vma, bool locked, struct list_head *ret)
I like two tabs indentations "slightly" over aligning with tabs + spaces. So
above looks good to me.
[...]
> @@ -1663,10 +1661,10 @@ static int migrate_hugetlbs(struct list_head *from, new_folio_t get_new_folio,
> continue;
> }
>
> - rc = unmap_and_move_huge_page(get_new_folio,
> - put_new_folio, private,
> - folio, pass > 2, mode,
> - reason, ret_folios);
> + rc = unmap_and_move_hugetlb_folio(get_new_folio,
> + put_new_folio, private,
> + folio, pass > 2, mode,
> + reason, ret_folios);
And for the same reason I wonder if we could use the two tabs indentation here.
That may reduce lines and make diffstat more cool? Just loudly wondering. My
R-b: is valid regardless.
Thanks,
SJ
[...]