Originally posted by man-walking
View Post
Zswap work out ok because the data has not gone to disc and the decompression time is less than the disc read.
You can see the overhead of compressing at the block layer here. Compressed swap would have to be implemented at the zswap or equal area.
A large ram zswap removes most of you swap io as well. Resulting in most of the blocks being sent to swap being uncompressed even if you attempt to compress them.
You are right the usually ram content should be highly compressible but when you have zswap consuming all that and keeping 90+ percent of that in memory resulting in the disc based swapfile getting like 90 percent uncompressed blocks compression on swapfile comes highly problem.
The reason why the feature was dropped in early prototype has not changed. You need x block of memory for X application to go forwards. You read a compressed block you need somewhere to store the compressed block plus where you will decompress it to. So 2 blocks for storage required instead of 1.
Yes decompressing zswap ram to swap device in fact makes sense in most cases.
Yes if you want to try compressed swap at the file system/block level you can attempt swap partition on vdo its not particularly nice.
https://github.com/dm-vdo yes the source to vdo is here. Its a feature that is not merged mainline Linux yet.
Compressed storage is slower storage.
zswap compressed memory blocks in ram is slow than uncompressed ram but faster than sending those blocks to disc and getting them back..
Now compressing swap on disc equals issue with extra ram requirement due to compression vdo suffers from this so would btrfs or zfs compressing swapfile. Also extra overhead from the compression. Swap thrashing from disc is bad enough without it being even slower and more ram requiring due to compression.
Yes system requirement guidelines with compressed vdo. So now you are burning more ram just so you can compress volume.
Comment