Re: [RFC PATCH v4 0/6] Promotion of Unmapped Page Cache Folios.

From: Gregory Price
Date: Sat Apr 12 2025 - 10:36:01 EST


On Sat, Apr 12, 2025 at 05:22:24PM +0530, Ritesh Harjani wrote:
> Gregory Price <gourry@xxxxxxxxxx> writes:
> 0: Demotion disabled
> 1: Demotion enabled for both anon and file pages
> Till here the support is already present.
>
> 2: Demotion enabled only for anon pages
> 3: Demotion enabled only for file pages
>
> Should this be further classified for dirty v/s clean page cache
> pages too?
>

There are some limitations around migrating dirty pages IIRC, but right
now the vmscan code indescriminately adds any and all folios to the
demotion list if it gets to that chunk of the code.

> > Assuming we can recognize anon from just struct folio
>
> I am not 100% sure of this, so others should correct. Should this
> simply be, folio_is_file_lru() to differentiate page cache pages?
>
> Although this still might give us anon pages which have the
> PG_swapbacked dropped as a result of MADV_FREE. Note sure if that need
> any special care though?
>

I made the comment without looking but yeah, PageAnon/folio_test_anon
exist, so this exists in some form somewhere. Basically there's some
space to do something a little less indescriminate here.

~Gregory