summaryrefslogtreecommitdiffstats
path: root/drivers/staging/zram/zram.txt
blob: 520edc1bea73c0c048b6da52eb0edd24ea360080 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
zram: Compressed RAM based block devices
----------------------------------------

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

* Introduction

The zram module creates RAM based block devices: /dev/ramX (X = 0, 1, ...).
Pages written to these disks are compressed and stored in memory itself.
These disks allow very fast I/O and compression provides good amounts of
memory savings.

See project home for use cases, performance numbers and a lot more.

Individual zram devices are configured and initialized using zramconfig
userspace utility as shown in examples below. See zramconfig man page for
more details.

* Usage

Following shows a typical sequence of steps for using zram.

1) Load Modules:
	modprobe zram num_devices=4
	This creates 4 (uninitialized) devices: /dev/zram{0,1,2,3}
	(num_devices parameter is optional. Default: 1)

2) Initialize:
	Use zramconfig utility to configure and initialize individual
	zram devices. For example:
	zramconfig /dev/zram0 --init # uses default value of disksize_kb
	zramconfig /dev/zram1 --disksize_kb=102400 # 100MB /dev/zram1

	*See zramconfig man page for more details and examples*

3) Activate:
	mkswap /dev/zram0
	swapon /dev/zram0

	mkfs.ext4 /dev/zram1
	mount /dev/zram1 /tmp

4) Stats:
	zramconfig /dev/zram0 --stats
	zramconfig /dev/zram1 --stats

5) Deactivate:
	swapoff /dev/zram0
	umount /dev/zram1

6) Reset:
	zramconfig /dev/zram0 --reset
	zramconfig /dev/zram1 --reset
	(This frees memory allocated for the given device).


Please report any problems at:
 - Mailing list: linux-mm-cc at laptop dot org
 - Issue tracker: http://code.google.com/p/compcache/issues/list

Nitin Gupta
ngupta@vflare.org
OpenPOWER on IntegriCloud