Re: [PATCH v1 22/29] mm/page-flags: rename PAGE_MAPPING_MOVABLE to PAGE_MAPPING_ANON_KSM

David Hildenbrand
2025-07-01T19:32:03Z

On 01.07.25 14:54, Lorenzo Stoakes wrote:
> On Mon, Jun 30, 2025 at 03:00:03PM +0200, David Hildenbrand wrote:
>> KSM is the only remaining user, let's rename the flag. While at it,
>> adjust to remaining page -> folio in the doc.
>
> Hm I wonder if we could just ideally have this be a separate flag rather than a
> bitwise combination, however I bet there's code that does somehow rely on this.

Well, KSM folios are anon folios, so that must hold.

Of course, now you could make folio_test_anon() test both bits, and have
KSM folios only set a PAGE_MAPPING_KSM bit.

That should be possible on top of this change, but not sure if that's
really what we want. After all, KSM folios are special ANON folios.

>
> I know for sure there's code that has to do a folio_test_ksm() on something
> folio_test_anon()'d because the latter isn't sufficient.
> > But this is one for the future I guess :)

Yes :)

>
> Nice: re change to folio, that is a nice cleanup based on fact you've now made
> the per-page mapping op stuff not be part of this.
>
>>
>> Reviewed-by: Zi Yan <ziy@nvidia.com>
>> Signed-off-by: David Hildenbrand <david@redhat.com>
>
> LGTM, so:
>
> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>

Thanks!

--
Cheers,

David / dhildenb