zswap can't use lz4 compression algorithm and z3fold pool anymore

Good afternoon! I’ve got a little problem on my side.

Recently, Linux kernel stopped using lz4 and z3fold as it’s being configured. Instead, in dmesg I get:

1.242353] zswap: compressor lz4 not available, using default lzo
1.244351] zswap: zpool z3fold not available, using default zbud
1.244358] zswap: loaded using pool lzo/zbud

Of course, I have taken measures to lz4/z3fold modules at boot. For example, in /etc/modules-load.d/ I placed lz4.conf and z3fold.conf with appropriate content abd I even messed with dracut and put the same-type configuration files in /etc/dracut.conf.d/, but nothing works.
But it was working only recently, I swear! I don’t know, however, when it happened (after 5.6 to 5.7 kernel upgrade?).

What /proc/cmdline says:

BOOT_IMAGE=/boot/vmlinuz-5.7.6-2.g1549350-default root=UUID=397167a8-8ff7-4e85-b9c9-d1aa4cc8ee34 splash=silent resume=/dev/disk/by-label/swap quiet loglevel=3 intel_iommu=on net.ifnames=0 biosdevname=0 zswap.enabled=1 zswap.compressor=lz4 zswap.max_pool_percent=20 zswap.zpool=z3fold mitigations=off

Last thing. When I check what modules are on with lsmod, lz4 and z3fold are present. Doesn’t this indicate that they are being loaded too late?

Disabled the stable kernel repository, switched to standard Tumbleweed kernel and got no results. I wonder if something in the 5.7 kernel changed that caused the problem.
By the way, can anyone provide me with 5.6 kernel to prove that? Mine was removed after updates, so I don’t have it anymore.

As I suspected, lz4/z3fold modules are being loaded after the zswap starts:

Jun 29 14:01:50 hostname kernel: zswap: compressor lz4 not available, using default lzo
Jun 29 14:01:50 hostname kernel: zswap: zpool z3fold not available, using default zbud

Jun 29 14:01:50 hostname systemd-modules-load[255]: Inserted module ‘lz4’
Jun 29 14:01:50 hostname systemd-modules-load[255]: Inserted module ‘z3fold’

Is there anything I can do with this? This is not critical for me, but still irritating.

zswap is built into kernel; there is no way you can load external modules before it starts.

Is there anything I can do with this?

Do not enable zswap on boot, enable it later after setting desired parameters. It can actually be enabled (and disabled) at any time: https://www.kernel.org/doc/html/latest/vm/zswap.html

Thanks, but how do best to manipulate sysfs variables automatically at boot time?

As usual - write service that runs at boot time. You can try existing one like GitHub - nefelim4ag/systemd-swap: Script for creating hybrid swap space from zram swaps, swap files and swap partitions.

Thank you very much. Too bad its’ scripts does not build RPM for OpenSUSE.

Hi
That’s pretty easy to do, but since it seems fluid (updated 35mins ago) it is probably better to create a quick script to update?

On OBS you can create a service and trigger that to auto get the source and rebuild and create your rpm locally with osc

There is always systemd-zram-service?

Actually, I am new to OpenSUSE. I am using it since mid-May and don’t know how things go here. Also, I am not sure I can write such script without anyone’s help.

https://build.opensuse.org/package/s…G/systemd-swap

That’s a repository for the package? Why can’t I download it? Is it still building?

Anyway, it’s a bed time for me and tomorrow is a planned electricity outage in my district, so I probably won’t be able to test it until evening. But thank you very much, you did a lot of help!

I downloaded the RPM, installed and configured it and it works! However, I can’t find the repository it resides in.

Hi
It’s not published yet… likely low priority since Leap 15.2 is about to release…

It will be down here: https://download.opensuse.org/repositories/home:/malcolmlewis:/TESTING/openSUSE_Tumbleweed/noarch/

Suggest just download and manually install with zypper.

I see it now. Thank you very much for everything!

Hi
You have a task now :wink: Keep an eye on the developer site, if it’s updated and want me to update, just send me a PM…

Okay, sure!