Hacker News new | ask | show | jobs
by chronogram 1694 days ago
zram*

zram is the compress-in-memory like you have in Windows and ChromeOS and zswap is the compress-on-disk in case you want to replace SD cards.

2 comments

zswap does not compress-on-disk either (I wish it did). The difference is just an implementation detail into how both plug into the kernel but the goal is the same on both.
zram is a compressed ram-disk that acts like any other block device, so you can point `mkswap` and `swapon` at it.

zswap is a compressed (memory) cache that uses the frontswap API to evict least recently used pages to a swap device. Evicted pages are not compressed.

zram is more of a general purpose component; whereas zswap is a more specialized component.

https://www.kernel.org/doc/Documentation/blockdev/zram.txt https://www.kernel.org/doc/html/latest/vm/zswap.html