| 1 |
What: /sys/block/zram<id>/disksize |
| 2 |
Date: August 2010 |
| 3 |
Contact: Nitin Gupta <[email protected]> |
| 4 |
Description: |
| 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 |
Unit: bytes |
| 9 |
|
| 10 |
What: /sys/block/zram<id>/initstate |
| 11 |
Date: August 2010 |
| 12 |
Contact: Nitin Gupta <[email protected]> |
| 13 |
Description: |
| 14 |
The initstate file is read-only and shows the initialization |
| 15 |
state of the device. |
| 16 |
|
| 17 |
What: /sys/block/zram<id>/reset |
| 18 |
Date: August 2010 |
| 19 |
Contact: Nitin Gupta <[email protected]> |
| 20 |
Description: |
| 21 |
The reset file is write-only and allows resetting the |
| 22 |
device. The reset operation frees all the memory associated |
| 23 |
with this device. |
| 24 |
|
| 25 |
What: /sys/block/zram<id>/comp_algorithm |
| 26 |
Date: February 2014 |
| 27 |
Contact: Sergey Senozhatsky <[email protected]> |
| 28 |
Description: |
| 29 |
The comp_algorithm file is read-write and lets to show |
| 30 |
available and selected compression algorithms, change |
| 31 |
compression algorithm selection. |
| 32 |
|
| 33 |
What: /sys/block/zram<id>/mem_used_max |
| 34 |
Date: August 2014 |
| 35 |
Contact: Minchan Kim <[email protected]> |
| 36 |
Description: |
| 37 |
The mem_used_max file is write-only and is used to reset |
| 38 |
the counter of maximum memory zram have consumed to store |
| 39 |
compressed data. For resetting the value, you should write |
| 40 |
"0". Otherwise, you could see -EINVAL. |
| 41 |
Unit: bytes |
| 42 |
|
| 43 |
What: /sys/block/zram<id>/mem_limit |
| 44 |
Date: August 2014 |
| 45 |
Contact: Minchan Kim <[email protected]> |
| 46 |
Description: |
| 47 |
The mem_limit file is write-only and specifies the maximum |
| 48 |
amount of memory ZRAM can use to store the compressed data. |
| 49 |
The limit could be changed in run time and "0" means disable |
| 50 |
the limit. No limit is the initial state. Unit: bytes |
| 51 |
|
| 52 |
What: /sys/block/zram<id>/compact |
| 53 |
Date: August 2015 |
| 54 |
Contact: Minchan Kim <[email protected]> |
| 55 |
Description: |
| 56 |
The compact file is write-only and trigger compaction for |
| 57 |
allocator zrm uses. The allocator moves some objects so that |
| 58 |
it could free fragment space. |
| 59 |
|
| 60 |
What: /sys/block/zram<id>/io_stat |
| 61 |
Date: August 2015 |
| 62 |
Contact: Sergey Senozhatsky <[email protected]> |
| 63 |
Description: |
| 64 |
The io_stat file is read-only and accumulates device's I/O |
| 65 |
statistics not accounted by block layer. For example, |
| 66 |
failed_reads, failed_writes, etc. File format is similar to |
| 67 |
block layer statistics file format. |
| 68 |
|
| 69 |
What: /sys/block/zram<id>/mm_stat |
| 70 |
Date: August 2015 |
| 71 |
Contact: Sergey Senozhatsky <[email protected]> |
| 72 |
Description: |
| 73 |
The mm_stat file is read-only and represents device's mm |
| 74 |
statistics (orig_data_size, compr_data_size, etc.) in a format |
| 75 |
similar to block layer statistics file format. |
| 76 |
|
| 77 |
What: /sys/block/zram<id>/debug_stat |
| 78 |
Date: July 2016 |
| 79 |
Contact: Sergey Senozhatsky <[email protected]> |
| 80 |
Description: |
| 81 |
The debug_stat file is read-only and represents various |
| 82 |
device's debugging info useful for kernel developers. Its |
| 83 |
format is not documented intentionally and may change |
| 84 |
anytime without any notice. |
| 85 |
|
| 86 |
What: /sys/block/zram<id>/backing_dev |
| 87 |
Date: June 2017 |
| 88 |
Contact: Minchan Kim <[email protected]> |
| 89 |
Description: |
| 90 |
The backing_dev file is read-write and set up backing |
| 91 |
device for zram to write incompressible pages. |
| 92 |
For using, user should enable CONFIG_ZRAM_WRITEBACK. |
| 93 |
|
| 94 |
What: /sys/block/zram<id>/idle |
| 95 |
Date: November 2018 |
| 96 |
Contact: Minchan Kim <[email protected]> |
| 97 |
Description: |
| 98 |
idle file is write-only and mark zram slot as idle. |
| 99 |
If system has mounted debugfs, user can see which slots |
| 100 |
are idle via /sys/kernel/debug/zram/zram<id>/block_state |
| 101 |
|
| 102 |
What: /sys/block/zram<id>/writeback |
| 103 |
Date: November 2018 |
| 104 |
Contact: Minchan Kim <[email protected]> |
| 105 |
Description: |
| 106 |
The writeback file is write-only and trigger idle and/or |
| 107 |
huge page writeback to backing device. |
| 108 |
|
| 109 |
What: /sys/block/zram<id>/bd_stat |
| 110 |
Date: November 2018 |
| 111 |
Contact: Minchan Kim <[email protected]> |
| 112 |
Description: |
| 113 |
The bd_stat file is read-only and represents backing device's |
| 114 |
statistics (bd_count, bd_reads, bd_writes) in a format |
| 115 |
similar to block layer statistics file format. |
| 116 |
|
| 117 |
What: /sys/block/zram<id>/writeback_limit_enable |
| 118 |
Date: November 2018 |
| 119 |
Contact: Minchan Kim <[email protected]> |
| 120 |
Description: |
| 121 |
The writeback_limit_enable file is read-write and specifies |
| 122 |
eanbe of writeback_limit feature. "1" means eable the feature. |
| 123 |
No limit "0" is the initial state. |
| 124 |
|
| 125 |
What: /sys/block/zram<id>/writeback_limit |
| 126 |
Date: November 2018 |
| 127 |
Contact: Minchan Kim <[email protected]> |
| 128 |
Description: |
| 129 |
The writeback_limit file is read-write and specifies the maximum |
| 130 |
amount of writeback ZRAM can do. The limit could be changed |
| 131 |
in run time. |
| 132 |
|
| 133 |
What: /sys/block/zram<id>/recomp_algorithm |
| 134 |
Date: November 2022 |
| 135 |
Contact: Sergey Senozhatsky <[email protected]> |
| 136 |
Description: |
| 137 |
The recomp_algorithm file is read-write and allows to set |
| 138 |
or show secondary compression algorithms. |
| 139 |
|
| 140 |
What: /sys/block/zram<id>/recompress |
| 141 |
Date: November 2022 |
| 142 |
Contact: Sergey Senozhatsky <[email protected]> |
| 143 |
Description: |
| 144 |
The recompress file is write-only and triggers re-compression |
| 145 |
with secondary compression algorithms. |
| 146 |
|
| 147 |
What: /sys/block/zram<id>/algorithm_params |
| 148 |
Date: August 2024 |
| 149 |
Contact: Sergey Senozhatsky <[email protected]> |
| 150 |
Description: |
| 151 |
The algorithm_params file is write-only and is used to setup |
| 152 |
compression algorithm parameters. |
| 153 |
|
| 154 |
What: /sys/block/zram<id>/compressed_writeback |
| 155 |
Date: Decemeber 2025 |
| 156 |
Contact: Richard Chang <[email protected]> |
| 157 |
Description: |
| 158 |
The compressed_writeback device atrribute toggles compressed |
| 159 |
writeback feature. |
| 160 |
|
| 161 |
What: /sys/block/zram<id>/writeback_batch_size |
| 162 |
Date: November 2025 |
| 163 |
Contact: Sergey Senozhatsky <[email protected]> |
| 164 |
Description: |
| 165 |
The writeback_batch_size device atrribute sets the maximum |
| 166 |
number of in-flight writeback operations. |