Re: Path forward for Virtualized Swap?
From: Gregory Price (Meta)
Date: Fri Oct 23 2026 - 17:53:27 EST
On 2026-10-23 13:25 -0700, Yosry Ahmed wrote:
> On Fri, Oct 23, 2026 at 1:03 PM Rik van Riel <riel@xxxxxxxxxxx> wrote:
> >
> > +-------+ +------------+
> > | vswap |-----| swap cache |
> > +---+---+ +------------+
> > |
> > +----------+-----------+
> > | | |
> > +---+---+ +---+---+ +---+---+
> > | swap | | zswap | | zram |
> > | file | | | | |
> > +-------+ +-------+ +-------+
> >
> > What exactly do people want to accomplish here?
>
> Today if you swapoff a swapfile, every is swapped in into the
> swapcache, whether it's in zswap or on disk. With vswap, you have no
> way to trigger swapin of compressed memory in zswap.
>
This seems like a missing interface in zswap, rather than something
vswap needs. But you could just write this as
vswap swapoff {
disable new backend writeback (swapcache fault-in only)
for each backend {
backend swapoff
}
}
so rather than vswap.swapoff() you'd actually just want a stop-bit that
says to disable the swap subsystem writeback behavior to all backends.
Otherwise the user can just disable each backend individually.
--
~Gregory