On Sat, Jun 6, 2020 at 10:00 AM Richard W.M. Jones <rjo...@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?!)


>
> > > Also what is the compression algorithm?  zlib or zstd or something
> > > else?
> >
> > zramctl shows ALGORITHM
> >
> > NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
> > /dev/zram0 lzo-rle      11.7G   4K   74B   12K       8 [SWAP]
> >
> > So it is lzo-rle by default, but it should be possible to override this
> > algorithm. There is an RFE for this already at zram-generator github.
>
> Interesting, thanks.  It looks like zstd is an alternative, although I
> don't know which will be better/faster.
>
> Rich.
>
> --
> Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
> Read my programming and virtualization blog: http://rwmj.wordpress.com
> virt-top is 'top' for virtual machines.  Tiny program with many
> powerful monitoring features, net stats, disk stats, logging, etc.
> http://people.redhat.com/~rjones/virt-top
> _______________________________________________
> devel mailing list -- devel@lists.fedoraproject.org
> To unsubscribe send an email to devel-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org



-- 
Chris Murphy
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org

Reply via email to