logoalt Hacker News

prussiantoday at 2:28 PM5 repliesview on HN

With zram, I can just use zram-generator[0] and it does everything for me and I don't even need to set anything up, other than installing the systemd generator, which on some distros, it's installed by default. Is there anything equivalent for zswap? Otherwise, I'm not surprised most people are just using zram, even if sub-optimal.

[0]: https://crates.io/crates/zram-generator


Replies

seba_dos1today at 6:46 PM

It's a handy tool, but it doesn't even give you a reasonable zram size by default and doesn't touch other things like page-cluster, so "I don't even need to set anything up" applies only if you don't mind it being quite far from optimal.

bilegeektoday at 4:53 PM

Kernel arguments are the primary method: https://wiki.archlinux.org/title/Zswap#Using_kernel_boot_par...

Snag: I had issues getting it to use zstd at boot. Not sure if it's a bug or some peculiarity with Debian. Ended up compiling my own kernel for other reasons, and was finally able to get zstd by default, but otherwise I'd have to make/add it to a startup script.

melvyn2today at 3:25 PM

  echo 1 > /sys/module/zswap/parameters/enabled

It's in TFA.
show 1 reply
alfanicktoday at 2:51 PM

This should've been a bash script...