Re: [PATCH 1/3] mm/migrate: rename page to folio leftovers
From: David Hildenbrand (Arm)
Date: Fri Jun 26 2026 - 13:03:54 EST
On 6/26/26 18:42, Garg, Shivank wrote:
>
>
> On 6/26/2026 9:40 PM, David Hildenbrand (Arm) wrote:
>> On 6/26/26 11:37, Shivank Garg wrote:
>>> Rename migrate_folio_undo_src()'s page_was_mapped parameter to
>>> folio_was_mapped, matching FOLIO_WAS_MAPPED naming.
>>>
>>> Also fix migrate_folio() kerneldoc to say "folio" instead of "page".
>>>
>>> Suggested-by: Dev Jain <dev.jain@xxxxxxx>
>>> Signed-off-by: Shivank Garg <shivankg@xxxxxxx>
>>> ---
>>> mm/migrate.c | 11 ++++-------
>>> 1 file changed, 4 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/mm/migrate.c b/mm/migrate.c
>>> index d9b23909d716..dd7dbd8d84a0 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 folio_was_mapped,
>>> + struct anon_vma *anon_vma, bool locked, struct list_head *ret)
>>> {
>>> - if (page_was_mapped)
>>> + if (folio_was_mapped)
>>
>> Why not "was_mapped" given that folio is part of the function name?
>>
>> (it's also not "folio_locked") :)
>>
>
> yes, makes sense. I'll use was_mapped.
>
> While here, what's your opinion on unmap_and_move_huge_page()?
> It also has local variable named page_was_mapped even though the function
> is fully folio-based. The function name and comments still have "page".
Ah, yeah ... please fix that.
And while at it, rename it to "unmap_and_move_hugetlb_folio". Thx :)
--
Cheers,
David