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: 80e98419c2SNitin Gupta The notify_free file is read-only and specifies the number of 81e98419c2SNitin Gupta swap slot free notifications received by this device. These 8251d8a7b0SBernhard M. Wiedemann notifications are sent to a swap block device when a swap slot 83e98419c2SNitin Gupta is freed. This statistic is applicable only when this disk is 84e98419c2SNitin Gupta being used as a swap disk. 85e98419c2SNitin Gupta 86e98419c2SNitin GuptaWhat: /sys/block/zram<id>/zero_pages 87e98419c2SNitin GuptaDate: August 2010 88e98419c2SNitin GuptaContact: Nitin Gupta <ngupta@vflare.org> 89e98419c2SNitin GuptaDescription: 90e98419c2SNitin Gupta The zero_pages file is read-only and specifies number of zero 91e98419c2SNitin Gupta filled pages written to this disk. No memory is allocated for 92e98419c2SNitin Gupta such pages. 93e98419c2SNitin Gupta 94e98419c2SNitin GuptaWhat: /sys/block/zram<id>/orig_data_size 95e98419c2SNitin GuptaDate: August 2010 96e98419c2SNitin GuptaContact: Nitin Gupta <ngupta@vflare.org> 97e98419c2SNitin GuptaDescription: 98e98419c2SNitin Gupta The orig_data_size file is read-only and specifies uncompressed 99e98419c2SNitin Gupta size of data stored in this disk. This excludes zero-filled 100e98419c2SNitin Gupta pages (zero_pages) since no memory is allocated for them. 101e98419c2SNitin Gupta Unit: bytes 102e98419c2SNitin Gupta 103e98419c2SNitin GuptaWhat: /sys/block/zram<id>/compr_data_size 104e98419c2SNitin GuptaDate: August 2010 105e98419c2SNitin GuptaContact: Nitin Gupta <ngupta@vflare.org> 106e98419c2SNitin GuptaDescription: 107e98419c2SNitin Gupta The compr_data_size file is read-only and specifies compressed 108e98419c2SNitin Gupta size of data stored in this disk. So, compression ratio can be 109e98419c2SNitin Gupta calculated using orig_data_size and this statistic. 110e98419c2SNitin Gupta Unit: bytes 111e98419c2SNitin Gupta 112e98419c2SNitin GuptaWhat: /sys/block/zram<id>/mem_used_total 113e98419c2SNitin GuptaDate: August 2010 114e98419c2SNitin GuptaContact: Nitin Gupta <ngupta@vflare.org> 115e98419c2SNitin GuptaDescription: 116e98419c2SNitin Gupta The mem_used_total file is read-only and specifies the amount 117e98419c2SNitin Gupta of memory, including allocator fragmentation and metadata 118e98419c2SNitin Gupta overhead, allocated for this disk. So, allocator space 119e98419c2SNitin Gupta efficiency can be calculated using compr_data_size and this 120e98419c2SNitin Gupta statistic. 121e98419c2SNitin Gupta Unit: bytes 1229ada9da9SMinchan Kim 123*461a8eeeSMinchan KimWhat: /sys/block/zram<id>/mem_used_max 124*461a8eeeSMinchan KimDate: August 2014 125*461a8eeeSMinchan KimContact: Minchan Kim <minchan@kernel.org> 126*461a8eeeSMinchan KimDescription: 127*461a8eeeSMinchan Kim The mem_used_max file is read/write and specifies the amount 128*461a8eeeSMinchan Kim of maximum memory zram have consumed to store compressed data. 129*461a8eeeSMinchan Kim For resetting the value, you should write "0". Otherwise, 130*461a8eeeSMinchan Kim you could see -EINVAL. 131*461a8eeeSMinchan Kim Unit: bytes 132*461a8eeeSMinchan Kim 1339ada9da9SMinchan KimWhat: /sys/block/zram<id>/mem_limit 1349ada9da9SMinchan KimDate: August 2014 1359ada9da9SMinchan KimContact: Minchan Kim <minchan@kernel.org> 1369ada9da9SMinchan KimDescription: 1379ada9da9SMinchan Kim The mem_limit file is read/write and specifies the maximum 1389ada9da9SMinchan Kim amount of memory ZRAM can use to store the compressed data. The 1399ada9da9SMinchan Kim limit could be changed in run time and "0" means disable the 1409ada9da9SMinchan Kim limit. No limit is the initial state. Unit: bytes 141