Skip to content

Remove zram size limit and disable zswap when using zram

Evangelos Foutras requested to merge zram-generator-fixes into master

Two fixes that I tested and deployed to build.archlinux.org:

zram-generator: Uncap max size of the zram device

Set "max-zram-size = none" to disable this unwanted limitation which
defaulted to creating zram-based swap with a maximum size of 4096MiB.

Fixes: dc8fa2bdfc86 ("common: Replace deprecated systemd-swap[1] with zram-generator")
zram-generator: use systemd-zram-setup@zram0 handler

Restarting swap.target doesn't apply configuration changes; instead we
can restart systemd-zram-setup@zram0 which seems to do what we wanted.

Bonus commit so that zramctl will display useful statistics:

zram: Disable zswap to prevent conflict with zram
    
When both zswap and zram are active, zswap sits in front of zram and
treats it as a backing store. We just want to use zram and not zswap
disguising itself as such; disable the latter so we can enjoy useful
zramctl statistics.
    
Implemented as tmpfiles.d/zram.conf which disables zswap at runtime.
Edited by Evangelos Foutras

Merge request reports

Loading