Lines Matching +full:block +full:- +full:number

2 zram: Compressed RAM-based block devices
8 The zram module creates RAM-based block devices named /dev/zram<id>
15 /sys/block/zram<id>/
20 There are several ways to configure and manage zram device(-s):
23 b) using zramctl utility, provided by util-linux (util-linux@vger.kernel.org).
28 In order to get a better idea about zramctl please consult util-linux
29 documentation, zramctl man-page or `zramctl --help`. Please be informed
30 that zram maintainers do not develop/maintain util-linux or zramctl, should
31 you have any questions please contact util-linux@vger.kernel.org
45 -EBUSY an attempt to modify an attribute that cannot be changed once
47 -ENOMEM zram was not able to allocate enough memory to fulfil your
49 -EINVAL invalid input has been provided.
50 -EAGAIN re-try operation later (e.g. when attempting to run recompress
57 echo foo > /sys/block/zram0/comp_algorithm
58 if [ $? -ne 0 ]; then
74 pre-created. Default: 1.
87 cat /sys/block/zram0/comp_algorithm
91 echo lzo > /sys/block/zram0/comp_algorithm
101 attribute which provides a per-algorithm params configuration.
104 In addition, certain compression algorithms support pre-trained dictionaries,
106 compression algorithm to use external pre-trained dictionary, pass full
109 #pass path to pre-trained zstd dictionary
110 echo "algo=zstd dict=/etc/dictionary" > /sys/block/zram0/algorithm_params
114 /sys/block/zram0/algorithm_params
116 #pass path to pre-trained zstd dictionary and compression level
118 /sys/block/zram0/algorithm_params
120 Parameters are algorithm specific: not all algorithms support pre-trained
135 echo $((50*1024*1024)) > /sys/block/zram0/disksize
138 echo 256K > /sys/block/zram0/disksize
139 echo 512M > /sys/block/zram0/disksize
140 echo 1G > /sys/block/zram0/disksize
156 echo $((50*1024*1024)) > /sys/block/zram0/mem_limit
159 echo 256K > /sys/block/zram0/mem_limit
160 echo 512M > /sys/block/zram0/mem_limit
161 echo 1G > /sys/block/zram0/mem_limit
164 echo 0 > /sys/block/zram0/mem_limit
180 zram provides a control interface, which enables dynamic (on-demand) device
189 cat /sys/class/zram-control/hot_add
195 echo X > /sys/class/zram-control/hot_remove
200 Per-device statistics are exported as various nodes under /sys/block/zram<id>/
203 please read Documentation/ABI/testing/sysfs-block-zram.
228 File /sys/block/zram<id>/stat
230 Represents block layer statistics. Read Documentation/block/stat.rst for
233 File /sys/block/zram<id>/io_stat
235 The stat file represents device's I/O statistics not accounted by block
241 failed_reads The number of failed reads
242 failed_writes The number of failed writes
243 invalid_io The number of non-page-size-aligned I/O requests
246 a) the number of pages freed because of swap slot free
248 b) the number of pages freed because of
250 sent to a swap block device when a swap slot is freed,
258 File /sys/block/zram<id>/mm_stat
276 same_pages the number of same element filled pages written to this disk.
278 pages_compacted the number of pages freed during compaction
279 huge_pages the number of incompressible pages
280 huge_pages_since the number of incompressible pages since zram set up
283 File /sys/block/zram<id>/bd_stat
291 bd_reads the number of reads from backing device
293 bd_writes the number of writes to backing device
310 echo 1 > /sys/block/zram0/reset
311 echo 1 > /sys/block/zram1/reset
321 -------------------
323 zram has built-in support for idle pages tracking (that is, allocated but
327 echo all > /sys/block/zramX/idle
330 removed only when the page (block) is accessed (e.g. overwritten or freed).
335 echo 86400 > /sys/block/zramX/idle
341 ---------
347 echo /dev/sda5 > /sys/block/zramX/backing_dev
352 echo huge > /sys/block/zramX/writeback
356 echo idle > /sys/block/zramX/writeback
363 echo huge_idle > /sys/block/zramX/writeback
368 echo incompressible > /sys/block/zramX/writeback
373 echo "page_index=1251" > /sys/block/zramX/writeback
378 `LOW-HIGH` range (or ranges) of pages to be written-back. This reduces the
379 number of syscalls, but more importantly this enables optimal post-processing
382 echo "type=idle" > /sys/block/zramX/writeback
383 echo "page_indexes=1-100 page_indexes=200-300" > \
384 /sys/block/zramX/writeback
389 echo page_index=42 page_index=99 page_indexes=100-200 \
390 page_indexes=500-700 > /sys/block/zramX/writeback
401 $ echo 1 > /sys/block/zramX/writeback_limit_enable
404 until admin sets the budget via /sys/block/zramX/writeback_limit.
407 assigned via /sys/block/zramX/writeback_limit is meaningless.)
409 If admin wants to limit writeback as per-day 400M, they could do it
415 /sys/block/zram0/writeback_limit.
416 $ echo 1 > /sys/block/zram0/writeback_limit_enable
422 /sys/block/zram0/writeback_limit
426 $ cat /sys/block/zramX/writeback_limit
430 $ echo 0 > /sys/block/zramX/writeback_limit_enable
433 system reboot, echo 1 > /sys/block/zramX/reset) so keeping how many of
438 know it via /sys/block/zram0/bd_stat's 3rd column.
441 -------------
449 recompression - pages that are cold and sit in the memory can be recompressed
460 cat /sys/block/zramX/recomp_algorithm
461 #1: lzo lzo-rle lz4 lz4hc [zstd]
462 #2: lzo lzo-rle lz4 [lz4hc] zstd
471 echo "algo=zstd priority=1" > /sys/block/zramX/recomp_algorithm
474 echo "algo=deflate priority=2" > /sys/block/zramX/recomp_algorithm
482 echo "type=idle" > /sys/block/zramX/recompress
485 echo "type=huge" > /sys/block/zram0/recompress
488 echo "type=huge_idle" > /sys/block/zramX/recompress
490 The number of idle pages can be significant, so user-space can pass a size
495 echo "threshold=3000" > /sys/block/zramX/recompress
498 echo "type=idle threshold=2000" > /sys/block/zramX/recompress
500 It is also possible to limit the number of pages zram re-compression will
503 echo "type=huge_idle max_pages=42" > /sys/block/zramX/recompress
505 During re-compression for every page, that matches re-compression criteria,
507 order of their priorities. ZRAM stops either when re-compression was
508 successful (re-compressed object is smaller in size than the original one)
509 and matches re-compression criteria (e.g. size threshold) or when there are
511 successfully re-compressed the page such a page is marked as incompressible,
512 so ZRAM will not attempt to re-compress it in the future.
514 This re-compression behaviour, when it iterates through the list of
522 echo "type=huge algo=zstd" > /sys/block/zramX/recompress
525 echo "type=huge priority=1" > /sys/block/zramX/recompress
531 zram block. It could be useful to catch cold or incompressible
534 If you enable the feature, you could see block state via
544 zram's block index.
548 state of the block:
563 First line of above example says 300th block is accessed at 75.033841sec
564 and the block's state is huge so it is written back to the backing