xref: /linux/Documentation/ABI/testing/sysfs-block-zram (revision 4f2109f60881585dc04fa0b5657a60556576625c)
1e98419c2SNitin GuptaWhat:		/sys/block/zram<id>/disksize
2e98419c2SNitin GuptaDate:		August 2010
3e98419c2SNitin GuptaContact:	Nitin Gupta <ngupta@vflare.org>
4e98419c2SNitin GuptaDescription:
5e98419c2SNitin Gupta		The disksize file is read-write and specifies the disk size
6e98419c2SNitin Gupta		which represents the limit on the *uncompressed* worth of data
7e98419c2SNitin Gupta		that can be stored in this disk.
851d8a7b0SBernhard M. Wiedemann		Unit: bytes
9e98419c2SNitin Gupta
10e98419c2SNitin GuptaWhat:		/sys/block/zram<id>/initstate
11e98419c2SNitin GuptaDate:		August 2010
12e98419c2SNitin GuptaContact:	Nitin Gupta <ngupta@vflare.org>
13e98419c2SNitin GuptaDescription:
1451d8a7b0SBernhard M. Wiedemann		The initstate file is read-only and shows the initialization
15e98419c2SNitin Gupta		state of the device.
16e98419c2SNitin Gupta
17e98419c2SNitin GuptaWhat:		/sys/block/zram<id>/reset
18e98419c2SNitin GuptaDate:		August 2010
19e98419c2SNitin GuptaContact:	Nitin Gupta <ngupta@vflare.org>
20e98419c2SNitin GuptaDescription:
2151d8a7b0SBernhard M. Wiedemann		The reset file is write-only and allows resetting the
2251d8a7b0SBernhard M. Wiedemann		device. The reset operation frees all the memory associated
23e98419c2SNitin Gupta		with this device.
24e98419c2SNitin Gupta
25e98419c2SNitin GuptaWhat:		/sys/block/zram<id>/num_reads
26e98419c2SNitin GuptaDate:		August 2010
27e98419c2SNitin GuptaContact:	Nitin Gupta <ngupta@vflare.org>
28e98419c2SNitin GuptaDescription:
29e98419c2SNitin Gupta		The num_reads file is read-only and specifies the number of
30e98419c2SNitin Gupta		reads (failed or successful) done on this device.
31e98419c2SNitin Gupta
32e98419c2SNitin GuptaWhat:		/sys/block/zram<id>/num_writes
33e98419c2SNitin GuptaDate:		August 2010
34e98419c2SNitin GuptaContact:	Nitin Gupta <ngupta@vflare.org>
35e98419c2SNitin GuptaDescription:
36e98419c2SNitin Gupta		The num_writes file is read-only and specifies the number of
37e98419c2SNitin Gupta		writes (failed or successful) done on this device.
38e98419c2SNitin Gupta
39e98419c2SNitin GuptaWhat:		/sys/block/zram<id>/invalid_io
40e98419c2SNitin GuptaDate:		August 2010
41e98419c2SNitin GuptaContact:	Nitin Gupta <ngupta@vflare.org>
42e98419c2SNitin GuptaDescription:
43e98419c2SNitin Gupta		The invalid_io file is read-only and specifies the number of
44e98419c2SNitin Gupta		non-page-size-aligned I/O requests issued to this device.
45e98419c2SNitin Gupta
468dd1d324SSergey SenozhatskyWhat:		/sys/block/zram<id>/failed_reads
478dd1d324SSergey SenozhatskyDate:		February 2014
488dd1d324SSergey SenozhatskyContact:	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
498dd1d324SSergey SenozhatskyDescription:
508dd1d324SSergey Senozhatsky		The failed_reads file is read-only and specifies the number of
518dd1d324SSergey Senozhatsky		failed reads happened on this device.
528dd1d324SSergey Senozhatsky
538dd1d324SSergey SenozhatskyWhat:		/sys/block/zram<id>/failed_writes
548dd1d324SSergey SenozhatskyDate:		February 2014
558dd1d324SSergey SenozhatskyContact:	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
568dd1d324SSergey SenozhatskyDescription:
578dd1d324SSergey Senozhatsky		The failed_writes file is read-only and specifies the number of
588dd1d324SSergey Senozhatsky		failed writes happened on this device.
598dd1d324SSergey Senozhatsky
60beca3ec7SSergey SenozhatskyWhat:		/sys/block/zram<id>/max_comp_streams
61beca3ec7SSergey SenozhatskyDate:		February 2014
62beca3ec7SSergey SenozhatskyContact:	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
63beca3ec7SSergey SenozhatskyDescription:
64beca3ec7SSergey Senozhatsky		The max_comp_streams file is read-write and specifies the
65beca3ec7SSergey Senozhatsky		number of backend's zcomp_strm compression streams (number of
66beca3ec7SSergey Senozhatsky		concurrent compress operations).
67beca3ec7SSergey Senozhatsky
68e46b8a03SSergey SenozhatskyWhat:		/sys/block/zram<id>/comp_algorithm
69e46b8a03SSergey SenozhatskyDate:		February 2014
70e46b8a03SSergey SenozhatskyContact:	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
71e46b8a03SSergey SenozhatskyDescription:
72e46b8a03SSergey Senozhatsky		The comp_algorithm file is read-write and lets to show
73e46b8a03SSergey Senozhatsky		available and selected compression algorithms, change
74e46b8a03SSergey Senozhatsky		compression algorithm selection.
75e46b8a03SSergey Senozhatsky
76e98419c2SNitin GuptaWhat:		/sys/block/zram<id>/notify_free
77e98419c2SNitin GuptaDate:		August 2010
78e98419c2SNitin GuptaContact:	Nitin Gupta <ngupta@vflare.org>
79e98419c2SNitin GuptaDescription:
80015254daSSergey Senozhatsky		The notify_free file is read-only. Depending on device usage
81015254daSSergey Senozhatsky		scenario it may account a) the number of pages freed because
82015254daSSergey Senozhatsky		of swap slot free notifications or b) the number of pages freed
83015254daSSergey Senozhatsky		because of REQ_DISCARD requests sent by bio. The former ones
84015254daSSergey Senozhatsky		are sent to a swap block device when a swap slot is freed, which
85015254daSSergey Senozhatsky		implies that this disk is being used as a swap disk. The latter
86015254daSSergey Senozhatsky		ones are sent by filesystem mounted with discard option,
87015254daSSergey Senozhatsky		whenever some data blocks are getting discarded.
88e98419c2SNitin Gupta
89e98419c2SNitin GuptaWhat:		/sys/block/zram<id>/zero_pages
90e98419c2SNitin GuptaDate:		August 2010
91e98419c2SNitin GuptaContact:	Nitin Gupta <ngupta@vflare.org>
92e98419c2SNitin GuptaDescription:
93e98419c2SNitin Gupta		The zero_pages file is read-only and specifies number of zero
94e98419c2SNitin Gupta		filled pages written to this disk. No memory is allocated for
95e98419c2SNitin Gupta		such pages.
96e98419c2SNitin Gupta
97e98419c2SNitin GuptaWhat:		/sys/block/zram<id>/orig_data_size
98e98419c2SNitin GuptaDate:		August 2010
99e98419c2SNitin GuptaContact:	Nitin Gupta <ngupta@vflare.org>
100e98419c2SNitin GuptaDescription:
101e98419c2SNitin Gupta		The orig_data_size file is read-only and specifies uncompressed
102e98419c2SNitin Gupta		size of data stored in this disk. This excludes zero-filled
103e98419c2SNitin Gupta		pages (zero_pages) since no memory is allocated for them.
104e98419c2SNitin Gupta		Unit: bytes
105e98419c2SNitin Gupta
106e98419c2SNitin GuptaWhat:		/sys/block/zram<id>/compr_data_size
107e98419c2SNitin GuptaDate:		August 2010
108e98419c2SNitin GuptaContact:	Nitin Gupta <ngupta@vflare.org>
109e98419c2SNitin GuptaDescription:
110e98419c2SNitin Gupta		The compr_data_size file is read-only and specifies compressed
111e98419c2SNitin Gupta		size of data stored in this disk. So, compression ratio can be
112e98419c2SNitin Gupta		calculated using orig_data_size and this statistic.
113e98419c2SNitin Gupta		Unit: bytes
114e98419c2SNitin Gupta
115e98419c2SNitin GuptaWhat:		/sys/block/zram<id>/mem_used_total
116e98419c2SNitin GuptaDate:		August 2010
117e98419c2SNitin GuptaContact:	Nitin Gupta <ngupta@vflare.org>
118e98419c2SNitin GuptaDescription:
119e98419c2SNitin Gupta		The mem_used_total file is read-only and specifies the amount
120e98419c2SNitin Gupta		of memory, including allocator fragmentation and metadata
121e98419c2SNitin Gupta		overhead, allocated for this disk. So, allocator space
122e98419c2SNitin Gupta		efficiency can be calculated using compr_data_size and this
123e98419c2SNitin Gupta		statistic.
124e98419c2SNitin Gupta		Unit: bytes
1259ada9da9SMinchan Kim
126461a8eeeSMinchan KimWhat:		/sys/block/zram<id>/mem_used_max
127461a8eeeSMinchan KimDate:		August 2014
128461a8eeeSMinchan KimContact:	Minchan Kim <minchan@kernel.org>
129461a8eeeSMinchan KimDescription:
130461a8eeeSMinchan Kim		The mem_used_max file is read/write and specifies the amount
131461a8eeeSMinchan Kim		of maximum memory zram have consumed to store compressed data.
132461a8eeeSMinchan Kim		For resetting the value, you should write "0". Otherwise,
133461a8eeeSMinchan Kim		you could see -EINVAL.
134461a8eeeSMinchan Kim		Unit: bytes
135461a8eeeSMinchan Kim
1369ada9da9SMinchan KimWhat:		/sys/block/zram<id>/mem_limit
1379ada9da9SMinchan KimDate:		August 2014
1389ada9da9SMinchan KimContact:	Minchan Kim <minchan@kernel.org>
1399ada9da9SMinchan KimDescription:
1409ada9da9SMinchan Kim		The mem_limit file is read/write and specifies the maximum
1419ada9da9SMinchan Kim		amount of memory ZRAM can use to store the compressed data.  The
1429ada9da9SMinchan Kim		limit could be changed in run time and "0" means disable the
1439ada9da9SMinchan Kim		limit.  No limit is the initial state.  Unit: bytes
1444e3ba878SMinchan Kim
1454e3ba878SMinchan KimWhat:		/sys/block/zram<id>/compact
1464e3ba878SMinchan KimDate:		August 2015
1474e3ba878SMinchan KimContact:	Minchan Kim <minchan@kernel.org>
1484e3ba878SMinchan KimDescription:
1494e3ba878SMinchan Kim		The compact file is write-only and trigger compaction for
1504e3ba878SMinchan Kim		allocator zrm uses. The allocator moves some objects so that
1514e3ba878SMinchan Kim		it could free fragment space.
1522f6a3bedSSergey Senozhatsky
1532f6a3bedSSergey SenozhatskyWhat:		/sys/block/zram<id>/io_stat
1542f6a3bedSSergey SenozhatskyDate:		August 2015
1552f6a3bedSSergey SenozhatskyContact:	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
1562f6a3bedSSergey SenozhatskyDescription:
1572f6a3bedSSergey Senozhatsky		The io_stat file is read-only and accumulates device's I/O
1582f6a3bedSSergey Senozhatsky		statistics not accounted by block layer. For example,
1592f6a3bedSSergey Senozhatsky		failed_reads, failed_writes, etc. File format is similar to
1602f6a3bedSSergey Senozhatsky		block layer statistics file format.
161*4f2109f6SSergey Senozhatsky
162*4f2109f6SSergey SenozhatskyWhat:		/sys/block/zram<id>/mm_stat
163*4f2109f6SSergey SenozhatskyDate:		August 2015
164*4f2109f6SSergey SenozhatskyContact:	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
165*4f2109f6SSergey SenozhatskyDescription:
166*4f2109f6SSergey Senozhatsky		The mm_stat file is read-only and represents device's mm
167*4f2109f6SSergey Senozhatsky		statistics (orig_data_size, compr_data_size, etc.) in a format
168*4f2109f6SSergey Senozhatsky		similar to block layer statistics file format.
169