blob: 0c7f4f91c6b527923b0728cb7f19bd4ef67a1eac [file] [log] [blame]
Nitin Guptae98419c2010-08-09 22:56:56 +05301What: /sys/block/zram<id>/disksize
2Date: August 2010
3Contact: Nitin Gupta <ngupta@vflare.org>
4Description:
5 The disksize file is read-write and specifies the disk size
6 which represents the limit on the *uncompressed* worth of data
7 that can be stored in this disk.
8
9What: /sys/block/zram<id>/initstate
10Date: August 2010
11Contact: Nitin Gupta <ngupta@vflare.org>
12Description:
13 The disksize file is read-only and shows the initialization
14 state of the device.
15
16What: /sys/block/zram<id>/reset
17Date: August 2010
18Contact: Nitin Gupta <ngupta@vflare.org>
19Description:
20 The disksize file is write-only and allows resetting the
21 device. The reset operation frees all the memory assocaited
22 with this device.
23
24What: /sys/block/zram<id>/num_reads
25Date: August 2010
26Contact: Nitin Gupta <ngupta@vflare.org>
27Description:
28 The num_reads file is read-only and specifies the number of
29 reads (failed or successful) done on this device.
30
31What: /sys/block/zram<id>/num_writes
32Date: August 2010
33Contact: Nitin Gupta <ngupta@vflare.org>
34Description:
35 The num_writes file is read-only and specifies the number of
36 writes (failed or successful) done on this device.
37
38What: /sys/block/zram<id>/invalid_io
39Date: August 2010
40Contact: Nitin Gupta <ngupta@vflare.org>
41Description:
42 The invalid_io file is read-only and specifies the number of
43 non-page-size-aligned I/O requests issued to this device.
44
Sergey Senozhatskyde980e92014-04-07 15:38:14 -070045What: /sys/block/zram<id>/failed_reads
46Date: February 2014
47Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
48Description:
49 The failed_reads file is read-only and specifies the number of
50 failed reads happened on this device.
51
52What: /sys/block/zram<id>/failed_writes
53Date: February 2014
54Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
55Description:
56 The failed_writes file is read-only and specifies the number of
57 failed writes happened on this device.
58
59What: /sys/block/zram<id>/max_comp_streams
60Date: February 2014
61Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
62Description:
63 The max_comp_streams file is read-write and specifies the
64 number of backend's zcomp_strm compression streams (number of
65 concurrent compress operations).
66
Sergey Senozhatsky0626b80d2014-04-07 15:38:17 -070067What: /sys/block/zram<id>/comp_algorithm
68Date: February 2014
69Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
70Description:
71 The comp_algorithm file is read-write and lets to show
72 available and selected compression algorithms, change
73 compression algorithm selection.
74
Nitin Guptae98419c2010-08-09 22:56:56 +053075What: /sys/block/zram<id>/notify_free
76Date: August 2010
77Contact: Nitin Gupta <ngupta@vflare.org>
78Description:
Sergey Senozhatskyc85f1d32014-10-09 15:29:57 -070079 The notify_free file is read-only. Depending on device usage
80 scenario it may account a) the number of pages freed because
81 of swap slot free notifications or b) the number of pages freed
82 because of REQ_DISCARD requests sent by bio. The former ones
83 are sent to a swap block device when a swap slot is freed, which
84 implies that this disk is being used as a swap disk. The latter
85 ones are sent by filesystem mounted with discard option,
86 whenever some data blocks are getting discarded.
Nitin Guptae98419c2010-08-09 22:56:56 +053087
88What: /sys/block/zram<id>/discard
89Date: August 2010
90Contact: Nitin Gupta <ngupta@vflare.org>
91Description:
92 The discard file is read-only and specifies the number of
93 discard requests received by this device. These requests
94 provide information to block device regarding blocks which are
95 no longer used by filesystem.
96
97What: /sys/block/zram<id>/zero_pages
98Date: August 2010
99Contact: Nitin Gupta <ngupta@vflare.org>
100Description:
101 The zero_pages file is read-only and specifies number of zero
102 filled pages written to this disk. No memory is allocated for
103 such pages.
104
105What: /sys/block/zram<id>/orig_data_size
106Date: August 2010
107Contact: Nitin Gupta <ngupta@vflare.org>
108Description:
109 The orig_data_size file is read-only and specifies uncompressed
110 size of data stored in this disk. This excludes zero-filled
111 pages (zero_pages) since no memory is allocated for them.
112 Unit: bytes
113
114What: /sys/block/zram<id>/compr_data_size
115Date: August 2010
116Contact: Nitin Gupta <ngupta@vflare.org>
117Description:
118 The compr_data_size file is read-only and specifies compressed
119 size of data stored in this disk. So, compression ratio can be
120 calculated using orig_data_size and this statistic.
121 Unit: bytes
122
123What: /sys/block/zram<id>/mem_used_total
124Date: August 2010
125Contact: Nitin Gupta <ngupta@vflare.org>
126Description:
127 The mem_used_total file is read-only and specifies the amount
128 of memory, including allocator fragmentation and metadata
129 overhead, allocated for this disk. So, allocator space
130 efficiency can be calculated using compr_data_size and this
131 statistic.
Jesper Juhlf9028312012-07-20 22:35:17 +0200132 Unit: bytes
Minchan Kim3c854b62014-10-09 15:29:53 -0700133
Minchan Kimcda6b062014-10-09 15:29:55 -0700134What: /sys/block/zram<id>/mem_used_max
135Date: August 2014
136Contact: Minchan Kim <minchan@kernel.org>
137Description:
138 The mem_used_max file is read/write and specifies the amount
139 of maximum memory zram have consumed to store compressed data.
140 For resetting the value, you should write "0". Otherwise,
141 you could see -EINVAL.
142 Unit: bytes
143
Minchan Kim3c854b62014-10-09 15:29:53 -0700144What: /sys/block/zram<id>/mem_limit
145Date: August 2014
146Contact: Minchan Kim <minchan@kernel.org>
147Description:
148 The mem_limit file is read/write and specifies the maximum
149 amount of memory ZRAM can use to store the compressed data. The
150 limit could be changed in run time and "0" means disable the
151 limit. No limit is the initial state. Unit: bytes