Re: [PATCH] mm/migrate: rename PAGE_ migration flags to FOLIO_MF_

From: David Hildenbrand (Arm)

Date: Mon Mar 23 2026 - 11:54:49 EST


On 3/23/26 15:46, Matthew Wilcox wrote:
> On Mon, Mar 23, 2026 at 02:19:37PM +0000, Shivank Garg wrote:
>> +++ b/mm/migrate.c
>> @@ -1135,26 +1135,26 @@ static int move_to_new_folio(struct folio *dst, struct folio *src,
>> * This is safe because nobody is using it except us.
>> */
>> enum {
>> - PAGE_WAS_MAPPED = BIT(0),
>> - PAGE_WAS_MLOCKED = BIT(1),
>> - PAGE_OLD_STATES = PAGE_WAS_MAPPED | PAGE_WAS_MLOCKED,
>> + FOLIO_MF_WAS_MAPPED = BIT(0),
>> + FOLIO_MF_WAS_MLOCKED = BIT(1),
>> + FOLIO_MF_OLD_STATES = FOLIO_MF_WAS_MAPPED | FOLIO_MF_WAS_MLOCKED,
>
> what does 'MF' stand for? i mean, presumably not the pop culture
> meaning of MF ...

Migration FLag

>
>> locked = true;
>> if (folio_test_mlocked(src))
>> - old_page_state |= PAGE_WAS_MLOCKED;
>> + old_folio_state |= FOLIO_MF_WAS_MLOCKED;
>
> I mean, this doesn't make sense any more. PAGE_WAS_MLOCKED is a
> sentence that means something. FOLIO_MF_WAS_MLOCKED doesn't ... unless
> you imagine Samuel L Jackson saying it ...

:)

PAGE_WAS_MLOCKED was suboptimal given that the names overlap with things
like PAGE_SHARED or even PAGE_IS_PRESENT.

So using some prefix to indicate that these flag belong logically
together makes sense. Even if it's not a beautiful sentence.

FOLIO_MIGRATION_* could be done, but "FOLIO_MIGRATION_WAS_MLOCKED" is
also does not make sense. FOLIO_MIGRATION_FLAG_* is mouthful.

--
Cheers,

David