RE: https://c.im/@lwnbot/116284493258223180
Nice reading although I still use zram for most.
RE: https://c.im/@lwnbot/116284493258223180
Nice reading although I still use zram for most.
Debunking Zswap and Zram Myths
https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html
#HackerNews #Debunking #Zswap #and #Zram #Myths #Zswap #Zram #Myths #Linux #Performance #Optimization
According to LWN kernel source DB, the number of my Linux mainline commits exceeded 1,000 with 6.19-rc1. It feels like a moment to me.
Most commits were made for DAMON, but the 1,000-th commit was for zswap ;)
$ git log --oneline --author "SeongJae" | grep damon | wc -l
872
$ nr=0; for c in $(git log --pretty=%h --reverse --author "SeongJae"); do nr=$((│[43] [PATCH v3] mm/damon/sysfs-schemes: Remove outdated TODO in target_nid_store() (Swaraj
nr + 1)); if [ "$nr" -eq 1000 ]; then git log "$c" -1 --pretty="%h %s"; fi; done
0fdaa13ee93a Docs/admin-guide/mm/zswap: s/red-black tree/xarray/
interesting discussion on the odd fact that in Linux we have #zram aka #zramswap (compressed swap in memory) and #zswap (compressed swap buffer in memory which decompresses the data before evicting it to a disk-based backing store if memory is getting low enough), without having simple compressed swap on disk:
https://unix.stackexchange.com/questions/740334/how-to-compress-disk-swap
Recently, I've been experiencing some lag (ie. opening Ghostty terminals) when browsing, playing RuneScape, and watching YouTube videos (all at the same time) on my Ubuntu laptop.
At first, I thought it could be due to the overhead of snaps (both Ghostty and Epiphany, my browser, are snaps), but after some monitoring with HTOP, I realized that I was using a lot of memory... particularly when watching YouTube videos in Epiphany and playing RuneScape at the same time. In fact, I was using so much memory I was hitting swap.
I didn't think this should have been a huge deal, however, because I had enabled zswap with lz4 compression (Ubuntu does not appear to support zstd). After looking at the parameters under /sys/module/zswap/parameters/, however, I noticed that my zpool was zbud, which is the default on Ubuntu.
Well it turns out that zbud... is not very effective and is in fact being deprecated:
https://www.spinics.net/lists/kernel/msg5527878.html
I decided to switch over to zsmalloc with the following in my /etc/default/grub:
GRUB_CMDLINE_LINUX="zswap.enabled=1 zswap.compressor=lz4 zswap.max_pool_percent=25 zswap.zpool=zsmalloc"
With this change, zswap appears to be much more effective and I have not experienced as much (if any) lag in terms of being able to open up Ghostty terminals while browsing, playing RuneScape, and watching YouTube videos.