Re: [PATCH] mm/migrate: rename PAGE_ migration flags to FOLIO_MF_
From: Matthew Wilcox
Date: Mon Mar 23 2026 - 15:17:15 EST
On Mon, Mar 23, 2026 at 04:36:38PM +0100, David Hildenbrand (Arm) wrote:
> On 3/23/26 15:46, Matthew Wilcox wrote:
> >> 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.
PAGE_SHARED (and friends) are misnamed because really they're PTE flags,
not page flags. Then PAGE_IS_* form a namespace for pagemap, which I
think is fine. These are PAGE_WAS, so a distinct namespace already.
> So using some prefix to indicate that these flag belong logically
> together makes sense. Even if it's not a beautiful sentence.
FOLIO_WAS_ seems like a fine namespace. Especially since it's local to
this file.