Thanks. I'm actually using zswap, which is better as it can move compressed pages between RAM and on-disk swap while zram only holds compressed pages in RAM. Zswap can be enabled simply by adding "zswap.enabled=1" to the kernel command line.
You are viewing a single comment's thread from:
From what I understand, zswap just compressed the pages it's going to swap out (reducing I/O - say a 10kb write becomes a 5kb write) and doesn't include zram-like functionality although I could be wrong.
Zram can be used to compress the pages it holds in the ram itself - so it avoids the I/O entirely. In my observation, average compression rates are ~3x in my machine for normal use. So in a 4GB machine with 3gb getting compressed with zram, the 3gb compressed can host ~9gb of data. Plus 1gb for the non-zram compressed, it totals around 10gb.
No, according to the kernel documentation zswap keeps compressed pages in a RAM-based memory pool and only moves them out to the on-disk swap when the compressed pool reaches its size limit.
Hmmm... nice. I'm using both zram and zswap on an old laptop of mine (it has an old 40gb pata - very slow) to reduce I/O, so I'll try at some point to see how it goes with zswap only.