Re: [PATCH v3 05/18] mm/huge_memory: rename __split_unmapped_folio() to __split_frozen_folio()
From: David Hildenbrand (Arm)
Date: Thu Aug 27 2026 - 12:23:39 EST
On 8/27/26 17:06, Kiryl Shutsemau wrote:
> On Fri, Aug 21, 2026 at 02:55:18AM +0800, Kairui Song via B4 Relay wrote:
>> From: Kairui Song <kasong@xxxxxxxxxxx>
>>
>> The helper splits a folio whose refcount is frozen: the frozen refcount
>> is the state it relies on, while unmapping is arranged by the caller
>> beforehand. The old name caused confusion and people may try to call the
>> helper on non-frozen folios.
>>
>> Suggested-by: Zi Yan <ziy@xxxxxxxxxx>
>> Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>
>> Signed-off-by: Kairui Song <kasong@xxxxxxxxxxx>
>
> This patch is fine:
>
> Reviewed-by: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>
>
>> @@ -3989,8 +3989,8 @@ static int __folio_freeze_split_unmapped_anon(struct folio *folio, unsigned int
>> if (do_lru)
>> lruvec = folio_lruvec_lock(folio);
>>
>> - ret = __split_unmapped_folio(folio, new_order, split_at, NULL,
>> - NULL, split_type);
>> + ret = __split_frozen_folio(folio, new_order, split_at, NULL,
>> + NULL, split_type);
>>
>> /*
>> * Unfreeze the post-split folios and put them back to the right
>> @@ -4053,8 +4053,8 @@ static int __folio_freeze_split_unmapped_file(struct folio *folio, unsigned int
>> if (do_lru)
>> lruvec = folio_lruvec_lock(folio);
>>
>> - ret = __split_unmapped_folio(folio, new_order, split_at, xas,
>> - mapping, split_type);
>> + ret = __split_frozen_folio(folio, new_order, split_at, xas,
>> + mapping, split_type);
>>
>> /*
>> * Unfreeze after-split folios and put them back to the right
>
> But now you have *unmapped_anon/file() call *frozen_folio().
>
> Given that you introduced *unmapped_anon/file() in the previous patch,
> why not give them the right names from the start?
>
+1
And just for completeness: we cannot possibly freeze a mapped folio. So frozen
implies unmapped.
So the function can possibly just be called
__folio_freeze_split_file
And we can can add a
VM_WARN_ON_ONCE(folio_mapped(folio));
to self-document the expectation in the code.
--
Cheers,
David