1# SPDX-License-Identifier: GPL-2.0 2config ZRAM 3 tristate "Compressed RAM block device support" 4 depends on BLOCK && SYSFS && MMU 5 select ZSMALLOC 6 help 7 Creates virtual block devices called /dev/zramX (X = 0, 1, ...). 8 Pages written to these disks are compressed and stored in memory 9 itself. These disks allow very fast I/O and compression provides 10 good amounts of memory savings. 11 12 It has several use cases, for example: /tmp storage, use as swap 13 disks and maybe many more. 14 15 See Documentation/admin-guide/blockdev/zram.rst for more information. 16 17config ZRAM_BACKEND_LZO 18 bool "lzo and lzo-rle compression support" 19 depends on ZRAM 20 select LZO_COMPRESS 21 select LZO_DECOMPRESS 22 23config ZRAM_BACKEND_LZ4 24 bool "lz4 compression support" 25 depends on ZRAM 26 select LZ4_COMPRESS 27 select LZ4_DECOMPRESS 28 29choice 30 prompt "Default zram compressor" 31 default ZRAM_DEF_COMP_LZORLE 32 depends on ZRAM 33 34config ZRAM_DEF_COMP_LZORLE 35 bool "lzo-rle" 36 depends on ZRAM_BACKEND_LZO 37 38config ZRAM_DEF_COMP_LZO 39 bool "lzo" 40 depends on ZRAM_BACKEND_LZO 41 42config ZRAM_DEF_COMP_LZ4 43 bool "lz4" 44 depends on ZRAM_BACKEND_LZ4 45 46endchoice 47 48config ZRAM_DEF_COMP 49 string 50 default "lzo-rle" if ZRAM_DEF_COMP_LZORLE 51 default "lzo" if ZRAM_DEF_COMP_LZO 52 default "lz4" if ZRAM_DEF_COMP_LZ4 53 default "unset-value" 54 55config ZRAM_WRITEBACK 56 bool "Write back incompressible or idle page to backing device" 57 depends on ZRAM 58 help 59 This lets zram entries (incompressible or idle pages) be written 60 back to a backing device, helping save memory. 61 For this feature, admin should set up backing device via 62 /sys/block/zramX/backing_dev. 63 64 With /sys/block/zramX/{idle,writeback}, application could ask 65 idle page's writeback to the backing device to save in memory. 66 67 See Documentation/admin-guide/blockdev/zram.rst for more information. 68 69config ZRAM_TRACK_ENTRY_ACTIME 70 bool "Track access time of zram entries" 71 depends on ZRAM 72 help 73 With this feature zram tracks access time of every stored 74 entry (page), which can be used for a more fine grained IDLE 75 pages writeback. 76 77config ZRAM_MEMORY_TRACKING 78 bool "Track zRam block status" 79 depends on ZRAM && DEBUG_FS 80 select ZRAM_TRACK_ENTRY_ACTIME 81 help 82 With this feature, admin can track the state of allocated blocks 83 of zRAM. Admin could see the information via 84 /sys/kernel/debug/zram/zramX/block_state. 85 86 See Documentation/admin-guide/blockdev/zram.rst for more information. 87 88config ZRAM_MULTI_COMP 89 bool "Enable multiple compression streams" 90 depends on ZRAM 91 help 92 This will enable multi-compression streams, so that ZRAM can 93 re-compress pages using a potentially slower but more effective 94 compression algorithm. Note, that IDLE page recompression 95 requires ZRAM_TRACK_ENTRY_ACTIME. 96