Giter Club home page Giter Club logo

android_external_compcache's Introduction

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

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

* Introduction
The ramzswap module creates RAM based block devices which can (only) be used as
swap disks. Pages swapped to these devices 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 the patch found in compcache/patches/ directory and just
	  compile the kernel as usual. Currently, the patch is against 2.6.33
	  but it should apply to slightly older kernels too. This will enable
	  'swap free notify' feature which 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
	  before compiling compcache against this patched kernel. Otherwise,
          this swap notify callback will not be used.

Following binaries are created:
  - ramzswap.ko (kernel driver)
  - sub-projects/rzscontrol/rzscontrol (userspace tool)

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

  1) Load Modules:
     # load dependency modules
     modprobe lzo_compress
     modprobe lzo_decompress

     # example1: load ramzswap module
     insmod ramzswap.ko num_devices=4

     This creates 4 devices (/dev/ramzswap{0,1,2,3}) which are left
     uninitialized.

     # example2: load ramzswap module and initialize the first device
     insmod ramzswap.ko num_devices=4 disksize_kb=20480

     This initializes first device (/dev/ramzswap0) with disksize of 20MB.
     Other 3 devices (/dev/ramzswap{1,2,3}) are left uninitialized.

  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:
     rmmod ramzswap
     rmmod lzo_compress
     rmmod lzo_decompress

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


Author: Nitin Gupta (ngupta at vflare dot org)
Last Updated: 24/1/2010

android_external_compcache's People

Contributors

hyperb1iss avatar tomgiordano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.