Sunday 12 June 2022

Re: systemd-oomd issues on desktop

On Fri, Jun 10, 2022 at 2:16 PM Sebastien Bacher <seb128@ubuntu.com> wrote:
>
> Le 09/06/2022 à 21:19, Dan Streetman a écrit :
> > Personally, I think this is the correct option. 1GB is not a good
> > default swap size.
>
> Did we ever consider doing the same than fedora is doing there?
>
> https://fedoraproject.org/wiki/Changes/SwapOnZRAM

compressed swap is generally good, when used lightly, and both zram
and zswap are good options, however each has significant downsides.
For zram, the downside is the unpredictability of pages that need to
be swapped, meaning some pages might be very poorly compressible; it
would be better to simply write out such pages to disk, but zram (when
acting as a swap device) isn't able to 'reject' poorly compressible
pages, which means the actual performance improvements of zram can be
highly variable depending on workload. Alternately zswap is able to
'reject' poorly compressible pages (i.e. let them get written to
disk), but the downside is you actually must have real disk swap
configured (because of how zswap is designed, using the 'frontswap'
hook); it can't do memory-only swap compression like zram.

One downside of both approaches (assuming a zram system also has
'fallback' real disk swap) is zram/zswap will fill up with swapped
pages (by design, obviously). If they get filled up (even partially)
with pages that really don't need to be accessed for a long time,
those compressed pages will stick around in memory, taking up space,
when it would have been better to simply write them out to disk. This
is particularly problematic once zram or zswap become 'full'. For
systems with *only* zram swap, this isn't an issue, since the only
options are 1) the page is in ram uncompressed or 2) the page is in
zram compresssed, which is why zram is particularly well suited to
embedded/iot systems without any disk swap.

The fedoraproject page there does lay out the comparison quite well,
but I'm not so sure enabling either by default for all users would be
appropriate. Also, I moved on from being an active zswap maintainer
years ago, so it's possible things have changed.

>
> Cheers,
> Sebastien Bacher
>
>
> --
> ubuntu-devel mailing list
> ubuntu-devel@lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel