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

From: Gregory Price
Date: Fri Apr 11 2025 - 20:44:31 EST


On Sat, Apr 12, 2025 at 01:35:56AM +0100, Matthew Wilcox wrote:
> On Fri, Apr 11, 2025 at 08:09:55PM -0400, Gregory Price wrote:
> > On Sat, Apr 12, 2025 at 12:49:18AM +0100, Matthew Wilcox wrote:
> > > On Fri, Apr 11, 2025 at 06:11:05PM -0400, Gregory Price wrote:
> > > > Unmapped page cache pages can be demoted to low-tier memory, but
> > >
> > > No. Page cache should never be demoted to low-tier memory.
> > > NACK this patchset.
> >
> > This wasn't a statement of approval page cache being on lower tiers,
> > it's a statement of fact. Enabling demotion causes this issue.
>
> Then that's the bug that needs to be fixed. Not adding 200+ lines
> of code to recover from a situation that should never happen.

Well, I have a use case that make valuable use of putting the page cache
on a farther node rather than pushing it out to disk. But this
discussion aside, I think we could simply make this a separate mode of
demotion_enabled

/* Only demote anonymous memory */
echo 2 > /sys/kernel/mm/numa/demotion_enabled

Assuming we can recognize anon from just struct folio

~Gregory