Fedora has been using zram since 33.
I wonder if the original reasoning still applies.
Chris Down makes a pretty convincing argument in favour of zswap.
Fedora has been using zram since 33.
I wonder if the original reasoning still applies.
Chris Down makes a pretty convincing argument in favour of zswap.
For the default Workstation case I think the old reasoning still mostly applies: zram is simple, has no dependency on a swap partition/file, and avoids pushing laptop workloads to disk just because memory got tight for a short time. zswap can be a good fit when you already have real swap behind it and want compressed cache before writeback, but that also makes the default more dependent on storage layout and tuning. So I would not read it as “zswap is worse”, more that zram is the safer boring default for very mixed Fedora installs.
I use ext4 as my root file system and have been using zswap for quite some time with zram disabled. I have had no issues of any kind and noticed no difference in performance.
I suspect one of the major factors that affect most who might consider switching to zswap is the fact that fedora uses a btrfs file system for the OS (and home) by default and that could definitely interfere with using zswap with a default installation. For simpicity and reliability it seems zswap would require one additional swap partition that is not created by default with a fedora installation.
Hi, I have three Fedora 44 WS systems and I use swap partitions and zram with different priorities: swap -2 and zram 100.
Thank you. I will thoroughly analyze the cited article.
I have zswap running with an encryped swap btrfs subvolume that I put into place following this guide. It has worked great.
This is on a Lenovo laptop with 8gb of memory dual booting Win11 and KDE Plasma.
Prior to changing to zswap, I would routinely hit the OOMD wall when I’d open more than one large pdf files, each of which might contain dense bitmapped engineering drawings; this wouid be accompanied by long delays. Since moving to the zswap strategy, I’ve encountered zero problems with this effect.
I’m not very knowledgeable but if I remember correctly zswap is incompatible with btrfs snapshots
According to this guide:
With the release of
btrfs-progs6.1 (available in Debian Bookworm), you can create a swap file using thebtrfsutility. It takes care of both preallocating the file and marking it asNODATACOW.
As BTRFS can’t snapshot a subvolume that contains an active swap file,
we will create a new subvolume for the swap file to reside in.
I followed the guide you referred to (modulo the encryption part) and everything worked nicely.
I also disabled zram by following the steps from the SwapOnZRAM change and enabled zswap by adding zswap.enabled=1 zswap.compressor=zstd zswap.max_pool_percent=25 zswap.accept_threshold_percent=90 to GRUB_CMDLINE_LINUX in /etc/default/grub and running sudo grub2-mkconfig -o /boot/grub2/grub.cfg.
I enabled it with this
zswap.enabled=1 zswap.max_pool_percent=25 zswap.compressor=lz4hc