^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) What: /sys/block/zram<id>/disksize
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) Date: August 2010
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) Contact: Nitin Gupta <ngupta@vflare.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) The disksize file is read-write and specifies the disk size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) which represents the limit on the *uncompressed* worth of data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) that can be stored in this disk.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) Unit: bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) What: /sys/block/zram<id>/initstate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) Date: August 2010
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) Contact: Nitin Gupta <ngupta@vflare.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) The initstate file is read-only and shows the initialization
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) state of the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) What: /sys/block/zram<id>/reset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) Date: August 2010
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) Contact: Nitin Gupta <ngupta@vflare.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) The reset file is write-only and allows resetting the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) device. The reset operation frees all the memory associated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) with this device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) What: /sys/block/zram<id>/max_comp_streams
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) Date: February 2014
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) The max_comp_streams file is read-write and specifies the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) number of backend's zcomp_strm compression streams (number of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) concurrent compress operations).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) What: /sys/block/zram<id>/comp_algorithm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) Date: February 2014
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) The comp_algorithm file is read-write and lets to show
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) available and selected compression algorithms, change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) compression algorithm selection.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) What: /sys/block/zram<id>/mem_used_max
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) Date: August 2014
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) Contact: Minchan Kim <minchan@kernel.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) The mem_used_max file is write-only and is used to reset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) the counter of maximum memory zram have consumed to store
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) compressed data. For resetting the value, you should write
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) "0". Otherwise, you could see -EINVAL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) Unit: bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) What: /sys/block/zram<id>/mem_limit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) Date: August 2014
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) Contact: Minchan Kim <minchan@kernel.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) The mem_limit file is write-only and specifies the maximum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) amount of memory ZRAM can use to store the compressed data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) The limit could be changed in run time and "0" means disable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) the limit. No limit is the initial state. Unit: bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) What: /sys/block/zram<id>/compact
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) Date: August 2015
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) Contact: Minchan Kim <minchan@kernel.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) The compact file is write-only and trigger compaction for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) allocator zrm uses. The allocator moves some objects so that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) it could free fragment space.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) What: /sys/block/zram<id>/io_stat
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) Date: August 2015
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) The io_stat file is read-only and accumulates device's I/O
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) statistics not accounted by block layer. For example,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) failed_reads, failed_writes, etc. File format is similar to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) block layer statistics file format.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) What: /sys/block/zram<id>/mm_stat
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) Date: August 2015
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) The mm_stat file is read-only and represents device's mm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) statistics (orig_data_size, compr_data_size, etc.) in a format
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) similar to block layer statistics file format.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) What: /sys/block/zram<id>/debug_stat
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) Date: July 2016
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) The debug_stat file is read-only and represents various
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) device's debugging info useful for kernel developers. Its
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) format is not documented intentionally and may change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) anytime without any notice.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) What: /sys/block/zram<id>/backing_dev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) Date: June 2017
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) Contact: Minchan Kim <minchan@kernel.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) The backing_dev file is read-write and set up backing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) device for zram to write incompressible pages.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) For using, user should enable CONFIG_ZRAM_WRITEBACK.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) What: /sys/block/zram<id>/idle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) Date: November 2018
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) Contact: Minchan Kim <minchan@kernel.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) idle file is write-only and mark zram slot as idle.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) If system has mounted debugfs, user can see which slots
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) are idle via /sys/kernel/debug/zram/zram<id>/block_state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) What: /sys/block/zram<id>/writeback
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) Date: November 2018
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) Contact: Minchan Kim <minchan@kernel.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) The writeback file is write-only and trigger idle and/or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) huge page writeback to backing device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) What: /sys/block/zram<id>/bd_stat
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) Date: November 2018
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) Contact: Minchan Kim <minchan@kernel.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) The bd_stat file is read-only and represents backing device's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) statistics (bd_count, bd_reads, bd_writes) in a format
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) similar to block layer statistics file format.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) What: /sys/block/zram<id>/writeback_limit_enable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) Date: November 2018
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) Contact: Minchan Kim <minchan@kernel.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) The writeback_limit_enable file is read-write and specifies
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) eanbe of writeback_limit feature. "1" means eable the feature.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) No limit "0" is the initial state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) What: /sys/block/zram<id>/writeback_limit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) Date: November 2018
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) Contact: Minchan Kim <minchan@kernel.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) The writeback_limit file is read-write and specifies the maximum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) amount of writeback ZRAM can do. The limit could be changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) in run time.