[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aNWRuKGurAntxhxG@gourry-fedora-PF4VCD3F>
Date: Thu, 25 Sep 2025 15:02:16 -0400
From: Gregory Price <gourry@...rry.net>
To: Jonathan Cameron <jonathan.cameron@...wei.com>
Cc: Yiannis Nikolakopoulos <yiannis.nikolakop@...il.com>,
Wei Xu <weixugc@...gle.com>, David Rientjes <rientjes@...gle.com>,
Matthew Wilcox <willy@...radead.org>,
Bharata B Rao <bharata@....com>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, dave.hansen@...el.com, hannes@...xchg.org,
mgorman@...hsingularity.net, mingo@...hat.com, peterz@...radead.org,
raghavendra.kt@....com, riel@...riel.com, sj@...nel.org,
ying.huang@...ux.alibaba.com, ziy@...dia.com, dave@...olabs.net,
nifan.cxl@...il.com, xuezhengchu@...wei.com,
akpm@...ux-foundation.org, david@...hat.com, byungchul@...com,
kinseyho@...gle.com, joshua.hahnjy@...il.com, yuanchu@...gle.com,
balbirs@...dia.com, alok.rathore@...sung.com, yiannis@...corp.com,
Adam Manzanares <a.manzanares@...sung.com>
Subject: Re: [RFC PATCH v2 0/8] mm: Hot page tracking and promotion
infrastructure
On Thu, Sep 25, 2025 at 06:23:08PM +0100, Jonathan Cameron wrote:
> On Thu, 25 Sep 2025 12:06:28 -0400
> Gregory Price <gourry@...rry.net> wrote:
>
> > It feels much more natural to put this as a zswap/zram backend.
> >
> Agreed. I currently see two paths that are generic (ish).
>
> 1. zswap route - faulting as you describe on writes.
aaaaaaaaaaaaaaaaaaaaaaah but therein lies the rub
The interposition point for zswap/zram is the PTE present bit being
hacked off to generate access faults.
If you want any random VMA to be eligible for demotion into the
tier, then you need to override that VMA's fault/protect hooks in its
vm_area_struct. This is idea is a non-starter.
What you'd have to do is have those particular vm_area_struct's be
provided by some special allocator that says the memory is eligible for
demotion to compressed memory, and to route all faults through it.
That looks a lot like hacking up mm internals to support a single
hardware case. Hard to justify.
This may quite literally only be possible to do for for unmapped pages,
which would limit the application to things like mm/filemap.c and making
IO (read/write) calls faster.
which - hey - maybe that's the best use-case anyway. Have all the
read-only compressible filecache you want. At least you avoid touching
disk.
~Gregory
Powered by blists - more mailing lists