
compcache: Compressed RAM based swap device
----------------------------------------

Project home: http://code.google.com/p/compcache

* Introduction
This is a RAM based block device which acts as swap disk.
Pages swapped to this device are compressed and stored in
memory itself.

* Use cases
 - (Swapless) Embedded devices.
 - Desktops with limited memory.

* Compiling and Using
 - Run 'make': this will compile all modules against your kernel.

 - Following kernel modules are created:
   - sub-projects/compression/lzo-kmod/lzo1x_compress.ko
   - sub-projects/compression/lzo-kmod/lzo1x_decompress.ko
   - sub-projects/allocators/tlsf-kmod/tlsf.ko
   - compcache.ko

 - Load all these modules (compcache.ko at last).

 - You can specify size of compcache while loading compcache.ko module as:

     insmod compcache.ko compcache_size_kbytes=10240
     (sets compcache size to 10M)

   If you do not specify any size, default compcache size (10% of RAM)
   is set.

 - Now, a virtual block device: /dev/compcache is created. Enable
   swapping on this device as:

     swapon /dev/compcache -p 1
     (-p sets swap device priority. compcache should be given highest priority.)

 - Verify that system has accepted this swap device using:

    cat /proc/swaps
    (/dev/compcache should be listed)

 - Done!

Now, when system swaps to this device, pages will be compressed and stored
in memory itself :)

* Common Problems
 - If you get lots of compile errors, make sure you have package for
   kernel source installed. For e.g., on Fedora its 'kernel-devel' package.
 - Make sure you load compcache module after tlsf and lzo* modules. Otherwise,
   you will get 'Unknown Symbol' errors while loading compcache module.


Please post any bugs/issues/suggestions on mailing list:
linux-mm-cc at laptop dot org.


- Nitin Gupta
(nitingupta910 at gmail dot com)
