Difference between revisions of "Zswap"

From ArchWiki
Jump to navigation Jump to search
m (Added links with related info)
(A bit of formatting and added instructions for using lz4.)
Line 10: Line 10:
  
 
==Get in work==
 
==Get in work==
For enable zswap, add to kernel boot options (line) this:
+
====For enable zswap, add to kernel boot options (line) this====
 
   zswap.enabled=1
 
   zswap.enabled=1
For customize maximum allowing size:
+
 
 +
====Customize the maximum allowed size====
 
   zswap.max_pool_percent=25
 
   zswap.max_pool_percent=25
For specify compress algorithm:
+
 
   zswap.compressor=lzo #deflate
+
====Changing the compression algorithm ====
 +
   zswap.compressor=lzo #deflate #lz4
 +
 
 +
====Enable LZ4 compression (faster than lzo and deflate, less compression) ====
 +
 
 +
#Add {{ic|1=lz4 lz4_compress}} to the [[Mkinitcpio#MODULES]] array.
 +
#Rerun {{ic|mkinitcpio}}.
 +
#Add {{ic|1=zswap.compressor=lz4}} to your kernel parameters [[Kernel_parameters#Configuration]].
 +
#Reboot
 +
#Check dmesg :
 +
    $ dmesg | grep 'zswap.* compressor'
 +
    [    0.307223] zswap: using lz4 compressor
  
 
== See also ==
 
== See also ==

Revision as of 09:58, 29 May 2014

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements. See Help:Style for reference.Tango-edit-clear.png

Reason: Grammar. (Discuss in Talk:Zswap#)

"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.

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)

  1. Add lz4 lz4_compress to the Mkinitcpio#MODULES array.
  2. Rerun mkinitcpio.
  3. Add zswap.compressor=lz4 to your kernel parameters Kernel_parameters#Configuration.
  4. Reboot
  5. Check dmesg :
   $ dmesg | grep 'zswap.* compressor'
   [    0.307223] zswap: using lz4 compressor

See also