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