On Thu, Oct 24, 2024 at 6:02 AM Konstantin Kharlamov <Hi-Angel@xxxxxxxxx> wrote: > > When ZSWAP is disabled, the `Zswap` and `Zswapped` in meminfo are still non-zero. > IOW, ZSWAP doesn't free memory upon being disabled. > > Stumbled upon this while trying to figure out where did ≈4G of my SWAP memory > disappear. Been seeing some unknown memory in SWAP for years, now I suspect ZSWAP > might be the culprit. But no way to know for sure because of this bug. > > # Steps to reproduce > > 1. Enable ZSWAP > 2. Wait for `grep Zswap /proc/meminfo` to become non-zero > 3. Disable ZSWAP via `sudo sh -c "echo 0 > /sys/module/zswap/parameters/enabled"` > 4. Look at `grep Zswap /proc/meminfo` > > ## Expected > > The rows are zero because ZSWAP is disabled. Not really, the expected behavior is that further swapouts will not go to zswap, but pages that are already compressed in zswap will not be written out to the backing swapfile or swapped back to memory. A swapoff would be required for the latter. This is documented in: https://docs.kernel.org/admin-guide/mm/zswap.html#overview. > > ## Actual > > The rows doesn't change. > > # Additional information > > Kernel: 6.11.3 > OS: Archlinux >