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 25beca3ec7SSergey SenozhatskyWhat: /sys/block/zram<id>/max_comp_streams 26beca3ec7SSergey SenozhatskyDate: February 2014 27beca3ec7SSergey SenozhatskyContact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> 28beca3ec7SSergey SenozhatskyDescription: 29beca3ec7SSergey Senozhatsky The max_comp_streams file is read-write and specifies the 30beca3ec7SSergey Senozhatsky number of backend's zcomp_strm compression streams (number of 31beca3ec7SSergey Senozhatsky concurrent compress operations). 32beca3ec7SSergey Senozhatsky 33e46b8a03SSergey SenozhatskyWhat: /sys/block/zram<id>/comp_algorithm 34e46b8a03SSergey SenozhatskyDate: February 2014 35e46b8a03SSergey SenozhatskyContact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> 36e46b8a03SSergey SenozhatskyDescription: 37e46b8a03SSergey Senozhatsky The comp_algorithm file is read-write and lets to show 38e46b8a03SSergey Senozhatsky available and selected compression algorithms, change 39e46b8a03SSergey Senozhatsky compression algorithm selection. 40e46b8a03SSergey Senozhatsky 41461a8eeeSMinchan KimWhat: /sys/block/zram<id>/mem_used_max 42461a8eeeSMinchan KimDate: August 2014 43461a8eeeSMinchan KimContact: Minchan Kim <minchan@kernel.org> 44461a8eeeSMinchan KimDescription: 45c87d1655SSergey Senozhatsky The mem_used_max file is write-only and is used to reset 46c87d1655SSergey Senozhatsky the counter of maximum memory zram have consumed to store 47c87d1655SSergey Senozhatsky compressed data. For resetting the value, you should write 48c87d1655SSergey Senozhatsky "0". Otherwise, you could see -EINVAL. 49461a8eeeSMinchan Kim Unit: bytes 50461a8eeeSMinchan Kim 519ada9da9SMinchan KimWhat: /sys/block/zram<id>/mem_limit 529ada9da9SMinchan KimDate: August 2014 539ada9da9SMinchan KimContact: Minchan Kim <minchan@kernel.org> 549ada9da9SMinchan KimDescription: 55c87d1655SSergey Senozhatsky The mem_limit file is write-only and specifies the maximum 56c87d1655SSergey Senozhatsky amount of memory ZRAM can use to store the compressed data. 57c87d1655SSergey Senozhatsky The limit could be changed in run time and "0" means disable 58c87d1655SSergey Senozhatsky the limit. No limit is the initial state. Unit: bytes 594e3ba878SMinchan Kim 604e3ba878SMinchan KimWhat: /sys/block/zram<id>/compact 614e3ba878SMinchan KimDate: August 2015 624e3ba878SMinchan KimContact: Minchan Kim <minchan@kernel.org> 634e3ba878SMinchan KimDescription: 644e3ba878SMinchan Kim The compact file is write-only and trigger compaction for 654e3ba878SMinchan Kim allocator zrm uses. The allocator moves some objects so that 664e3ba878SMinchan Kim it could free fragment space. 672f6a3bedSSergey Senozhatsky 682f6a3bedSSergey SenozhatskyWhat: /sys/block/zram<id>/io_stat 692f6a3bedSSergey SenozhatskyDate: August 2015 702f6a3bedSSergey SenozhatskyContact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> 712f6a3bedSSergey SenozhatskyDescription: 722f6a3bedSSergey Senozhatsky The io_stat file is read-only and accumulates device's I/O 732f6a3bedSSergey Senozhatsky statistics not accounted by block layer. For example, 742f6a3bedSSergey Senozhatsky failed_reads, failed_writes, etc. File format is similar to 752f6a3bedSSergey Senozhatsky block layer statistics file format. 764f2109f6SSergey Senozhatsky 774f2109f6SSergey SenozhatskyWhat: /sys/block/zram<id>/mm_stat 784f2109f6SSergey SenozhatskyDate: August 2015 794f2109f6SSergey SenozhatskyContact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> 804f2109f6SSergey SenozhatskyDescription: 814f2109f6SSergey Senozhatsky The mm_stat file is read-only and represents device's mm 824f2109f6SSergey Senozhatsky statistics (orig_data_size, compr_data_size, etc.) in a format 834f2109f6SSergey Senozhatsky similar to block layer statistics file format. 84623e47fcSSergey Senozhatsky 85623e47fcSSergey SenozhatskyWhat: /sys/block/zram<id>/debug_stat 86623e47fcSSergey SenozhatskyDate: July 2016 87623e47fcSSergey SenozhatskyContact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> 88623e47fcSSergey SenozhatskyDescription: 89623e47fcSSergey Senozhatsky The debug_stat file is read-only and represents various 90623e47fcSSergey Senozhatsky device's debugging info useful for kernel developers. Its 91623e47fcSSergey Senozhatsky format is not documented intentionally and may change 92623e47fcSSergey Senozhatsky anytime without any notice. 935a47074fSMinchan Kim 945a47074fSMinchan KimWhat: /sys/block/zram<id>/backing_dev 955a47074fSMinchan KimDate: June 2017 965a47074fSMinchan KimContact: Minchan Kim <minchan@kernel.org> 975a47074fSMinchan KimDescription: 985a47074fSMinchan Kim The backing_dev file is read-write and set up backing 995a47074fSMinchan Kim device for zram to write incompressible pages. 1005a47074fSMinchan Kim For using, user should enable CONFIG_ZRAM_WRITEBACK. 101e82592c4SMinchan Kim 102e82592c4SMinchan KimWhat: /sys/block/zram<id>/idle 103e82592c4SMinchan KimDate: November 2018 104e82592c4SMinchan KimContact: Minchan Kim <minchan@kernel.org> 105e82592c4SMinchan KimDescription: 106e82592c4SMinchan Kim idle file is write-only and mark zram slot as idle. 107e82592c4SMinchan Kim If system has mounted debugfs, user can see which slots 108e82592c4SMinchan Kim are idle via /sys/kernel/debug/zram/zram<id>/block_state 109a939888eSMinchan Kim 110a939888eSMinchan KimWhat: /sys/block/zram<id>/writeback 111a939888eSMinchan KimDate: November 2018 112a939888eSMinchan KimContact: Minchan Kim <minchan@kernel.org> 113a939888eSMinchan KimDescription: 114a939888eSMinchan Kim The writeback file is write-only and trigger idle and/or 115a939888eSMinchan Kim huge page writeback to backing device. 11623eddf39SMinchan Kim 11723eddf39SMinchan KimWhat: /sys/block/zram<id>/bd_stat 11823eddf39SMinchan KimDate: November 2018 11923eddf39SMinchan KimContact: Minchan Kim <minchan@kernel.org> 12023eddf39SMinchan KimDescription: 12123eddf39SMinchan Kim The bd_stat file is read-only and represents backing device's 12223eddf39SMinchan Kim statistics (bd_count, bd_reads, bd_writes) in a format 12323eddf39SMinchan Kim similar to block layer statistics file format. 124bb416d18SMinchan Kim 1251d69a3f8SMinchan KimWhat: /sys/block/zram<id>/writeback_limit_enable 1261d69a3f8SMinchan KimDate: November 2018 1271d69a3f8SMinchan KimContact: Minchan Kim <minchan@kernel.org> 1281d69a3f8SMinchan KimDescription: 1291d69a3f8SMinchan Kim The writeback_limit_enable file is read-write and specifies 1301d69a3f8SMinchan Kim eanbe of writeback_limit feature. "1" means eable the feature. 1311d69a3f8SMinchan Kim No limit "0" is the initial state. 1321d69a3f8SMinchan Kim 133bb416d18SMinchan KimWhat: /sys/block/zram<id>/writeback_limit 134bb416d18SMinchan KimDate: November 2018 135bb416d18SMinchan KimContact: Minchan Kim <minchan@kernel.org> 136bb416d18SMinchan KimDescription: 137bb416d18SMinchan Kim The writeback_limit file is read-write and specifies the maximum 138bb416d18SMinchan Kim amount of writeback ZRAM can do. The limit could be changed 1391d69a3f8SMinchan Kim in run time. 140*c959a0e8SSergey Senozhatsky 141*c959a0e8SSergey SenozhatskyWhat: /sys/block/zram<id>/recomp_algorithm 142*c959a0e8SSergey SenozhatskyDate: November 2022 143*c959a0e8SSergey SenozhatskyContact: Sergey Senozhatsky <senozhatsky@chromium.org> 144*c959a0e8SSergey SenozhatskyDescription: 145*c959a0e8SSergey Senozhatsky The recomp_algorithm file is read-write and allows to set 146*c959a0e8SSergey Senozhatsky or show secondary compression algorithms. 147*c959a0e8SSergey Senozhatsky 148*c959a0e8SSergey SenozhatskyWhat: /sys/block/zram<id>/recompress 149*c959a0e8SSergey SenozhatskyDate: November 2022 150*c959a0e8SSergey SenozhatskyContact: Sergey Senozhatsky <senozhatsky@chromium.org> 151*c959a0e8SSergey SenozhatskyDescription: 152*c959a0e8SSergey Senozhatsky The recompress file is write-only and triggers re-compression 153*c959a0e8SSergey Senozhatsky with secondary compression algorithms. 154