ramzswap: Compressed RAM based swap device
-------------------------------------------

Project home: http://compcache.googlecode.com/

* 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. See project home for use cases, performance
numbers and a lot more.

Help page:
   http://compcache.googlecode.com/CompilingAndUsingNew

* Compiling
 - 'make':	This will compile all modules against your kernel
 - 'make doc':	This will compile rzscontrol manual page:
		sub-projects/rzscontrol/man/rzscontrol.1

 Optional (HIGHLY RECOMMENDED):
   - Apply patch found in patches directory. This will enable 'swap free notify'
     feature. This allows kernel to send callback to ramzswap as soon as a swap
     slot becomes free. So, we can immediately free memory allocated for this
     page, eliminating any stale data in (compressed) memory.

   - Uncomment '#define CONFIG_SWAP_FREE_NOTIFY' in compcache/compat.h if you
     apply this patch.

   NOTE: ramzswap will work on kernels with or without this patch. Of course,
   this feature will be disabled if compiled against kernel without this patch.

 After compilation, following modules are created:
   - xvmalloc.ko
   - ramzswap.ko
   - sub-projects/rzscontrol/rzscontrol (userspace)

* Using
Following shows a typical sequence of steps for using ramzswap.

  1) Load Modules:
     ./load_modules 4
     This creates 4 (uninitialized) devices: /dev/ramzswap{0,1,2,3}
     (on some distributions, /dev/block/ramzswapX nodes are created instead)

  2) Initialize:
     Use rzscontrol utility to configure and initialize individual
     ramzswap devices. Example:
        rzscontrol /dev/ramzswap0 --init # uses default value of disksize_kb

     *See rzscontrol manpage for more details and examples*

  3) Activate:
     swapon /dev/ramzswap2 # or any other initialized ramzswap device

  4) Stats:
     rzscontrol /dev/ramzswap2 --stats

  5) Deactivate:
     swapoff /dev/ramzswap2

  6) Reset:
     rzscontrol /dev/ramzswap2 --reset

  7) Unload Modules:
     ./unload_modules

* Common Problems
 - If you get lots of compiler errors, make sure you have the package for
   kernel source installed. For e.g., on Fedora its 'kernel-devel' package.


Please consider using Issue Tracker:
http://code.google.com/p/compcache/issues/list
for reporting any bugs/feature requests.

Cheers!
Nitin Gupta
ngupta at vflare dot org

