Zswap
Jump to navigation
Jump to search
"Zswap is a Linux kernel feature providing a compressed write-back cache for swapped pages. Instead of moving memory pages to a swap device when they are to be swapped out, zswap performs their compression and then stores them into a memory pool dynamically allocated inside system's RAM." - Wikipedia
In simple words, zswap - no swap as zram(compcache) or swap file/partition. Zswap only interlayer, for work this feature you need manually setup swap partition/file.
Contents
Get in work
For enable zswap, add to kernel boot options (line) this
zswap.enabled=1
Customize the maximum allowed size
zswap.max_pool_percent=25
Changing the compression algorithm
zswap.compressor=lzo #deflate #lz4
Enable LZ4 compression (faster than lzo and deflate, less compression)
- Add
lz4 lz4_compress
to the Mkinitcpio#MODULES array. - Rerun
mkinitcpio
. - Add
zswap.compressor=lz4
to your kernel parameters Kernel_parameters#Configuration. - Reboot
- Check dmesg :
$ dmesg | grep 'zswap.* compressor' [ 0.307223] zswap: using lz4 compressor