1 What: /sys/block/zram<id>/disksize
3 Contact: Nitin Gupta <ngupta@vflare.org>
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.
10 What: /sys/block/zram<id>/initstate
12 Contact: Nitin Gupta <ngupta@vflare.org>
14 The initstate file is read-only and shows the initialization
17 What: /sys/block/zram<id>/reset
19 Contact: Nitin Gupta <ngupta@vflare.org>
21 The reset file is write-only and allows resetting the
22 device. The reset operation frees all the memory associated
25 What: /sys/block/zram<id>/num_reads
27 Contact: Nitin Gupta <ngupta@vflare.org>
29 The num_reads file is read-only and specifies the number of
30 reads (failed or successful) done on this device.
32 What: /sys/block/zram<id>/num_writes
34 Contact: Nitin Gupta <ngupta@vflare.org>
36 The num_writes file is read-only and specifies the number of
37 writes (failed or successful) done on this device.
39 What: /sys/block/zram<id>/invalid_io
41 Contact: Nitin Gupta <ngupta@vflare.org>
43 The invalid_io file is read-only and specifies the number of
44 non-page-size-aligned I/O requests issued to this device.
46 What: /sys/block/zram<id>/failed_reads
48 Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
50 The failed_reads file is read-only and specifies the number of
51 failed reads happened on this device.
53 What: /sys/block/zram<id>/failed_writes
55 Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
57 The failed_writes file is read-only and specifies the number of
58 failed writes happened on this device.
60 What: /sys/block/zram<id>/max_comp_streams
62 Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
64 The max_comp_streams file is read-write and specifies the
65 number of backend's zcomp_strm compression streams (number of
66 concurrent compress operations).
68 What: /sys/block/zram<id>/comp_algorithm
70 Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
72 The comp_algorithm file is read-write and lets to show
73 available and selected compression algorithms, change
74 compression algorithm selection.
76 What: /sys/block/zram<id>/notify_free
78 Contact: Nitin Gupta <ngupta@vflare.org>
80 The notify_free file is read-only. Depending on device usage
81 scenario it may account a) the number of pages freed because
82 of swap slot free notifications or b) the number of pages freed
83 because of REQ_DISCARD requests sent by bio. The former ones
84 are sent to a swap block device when a swap slot is freed, which
85 implies that this disk is being used as a swap disk. The latter
86 ones are sent by filesystem mounted with discard option,
87 whenever some data blocks are getting discarded.
89 What: /sys/block/zram<id>/zero_pages
91 Contact: Nitin Gupta <ngupta@vflare.org>
93 The zero_pages file is read-only and specifies number of zero
94 filled pages written to this disk. No memory is allocated for
97 What: /sys/block/zram<id>/orig_data_size
99 Contact: Nitin Gupta <ngupta@vflare.org>
101 The orig_data_size file is read-only and specifies uncompressed
102 size of data stored in this disk. This excludes zero-filled
103 pages (zero_pages) since no memory is allocated for them.
106 What: /sys/block/zram<id>/compr_data_size
108 Contact: Nitin Gupta <ngupta@vflare.org>
110 The compr_data_size file is read-only and specifies compressed
111 size of data stored in this disk. So, compression ratio can be
112 calculated using orig_data_size and this statistic.
115 What: /sys/block/zram<id>/mem_used_total
117 Contact: Nitin Gupta <ngupta@vflare.org>
119 The mem_used_total file is read-only and specifies the amount
120 of memory, including allocator fragmentation and metadata
121 overhead, allocated for this disk. So, allocator space
122 efficiency can be calculated using compr_data_size and this
126 What: /sys/block/zram<id>/mem_used_max
128 Contact: Minchan Kim <minchan@kernel.org>
130 The mem_used_max file is read/write and specifies the amount
131 of maximum memory zram have consumed to store compressed data.
132 For resetting the value, you should write "0". Otherwise,
133 you could see -EINVAL.
136 What: /sys/block/zram<id>/mem_limit
138 Contact: Minchan Kim <minchan@kernel.org>
140 The mem_limit file is read/write and specifies the maximum
141 amount of memory ZRAM can use to store the compressed data. The
142 limit could be changed in run time and "0" means disable the
143 limit. No limit is the initial state. Unit: bytes
145 What: /sys/block/zram<id>/compact
147 Contact: Minchan Kim <minchan@kernel.org>
149 The compact file is write-only and trigger compaction for
150 allocator zrm uses. The allocator moves some objects so that
151 it could free fragment space.
153 What: /sys/block/zram<id>/io_stat
155 Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
157 The io_stat file is read-only and accumulates device's I/O
158 statistics not accounted by block layer. For example,
159 failed_reads, failed_writes, etc. File format is similar to
160 block layer statistics file format.
162 What: /sys/block/zram<id>/mm_stat
164 Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
166 The mm_stat file is read-only and represents device's mm
167 statistics (orig_data_size, compr_data_size, etc.) in a format
168 similar to block layer statistics file format.