On Saturday, June 6, 2020 3:55:42 PM MST Chris Murphy wrote:
On Sat, Jun 6, 2020 at 10:00 AM Richard W.M. Jones
<rjones(a)redhat.com>
wrote:
>
>
> But let's say we also add a lower priority disk swap, then my next
> question ...
>
>
>
> > > Also does the swap partition on disk contain compressed pages, or
> > > uncompressed pages, or a mix of both?
> >
> >
> >
> > With zram there is no partition on disk, or was this question about
> > something else?
>
>
>
> ... means: Does this secondary swap partition (on disk) contain
> swapped out zram pages? Or uncompressed pages? (Or maybe the
> question just makes no sense, I don't really know.)
(ZRAM)
Compression is intrinsic to just the /dev/zram device. The swap code
doesn't share pages between swap devices. The higher priority device
is favored first until full. Once full, pages don't go through the
zram module, thus are not compressed, on their way to the
swap-on-disk.
(ZSWAP)
So yeah, the swap-on-disk scenario might be better suited to a
generator that could use zswap instead, which uses an existing swap
partition and adds a write back cache (zpool) rather than a separate
device. I'm pretty sure (not 100%) that cached page are decompressed
on their way to the swap device. Also, the zpool memory cache is
preallocated, unlike zram devices.
(I am not going to envy any who decide to implement zswap on a system
with ZFS. Wait wait wait, which zpool are you talking about?!)
Which zswap are you talking about?
Swap on compressed zvol has been called zswap at times. ;)
- -
John M. Harris, Jr.