1 # SPDX-License-Identifier: GPL-2.0
3 tristate "Compressed RAM block device support"
4 depends on BLOCK && SYSFS && MMU
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.
12 It has several use cases, for example: /tmp storage, use as swap
13 disks and maybe many more.
15 See Documentation/admin-guide/blockdev/zram.rst for more information.
17 config ZRAM_BACKEND_LZ4
18 bool "lz4 compression support"
23 config ZRAM_BACKEND_LZ4HC
24 bool "lz4hc compression support"
29 config ZRAM_BACKEND_ZSTD
30 bool "zstd compression support"
33 select ZSTD_DECOMPRESS
35 config ZRAM_BACKEND_DEFLATE
36 bool "deflate compression support"
41 config ZRAM_BACKEND_842
42 bool "842 compression support"
47 config ZRAM_BACKEND_FORCE_LZO
49 def_bool !ZRAM_BACKEND_LZ4 && !ZRAM_BACKEND_LZ4HC && \
50 !ZRAM_BACKEND_ZSTD && !ZRAM_BACKEND_DEFLATE && \
53 config ZRAM_BACKEND_LZO
54 bool "lzo and lzo-rle compression support" if !ZRAM_BACKEND_FORCE_LZO
56 default ZRAM_BACKEND_FORCE_LZO
61 prompt "Default zram compressor"
62 default ZRAM_DEF_COMP_LZORLE
65 config ZRAM_DEF_COMP_LZORLE
67 depends on ZRAM_BACKEND_LZO
69 config ZRAM_DEF_COMP_LZO
71 depends on ZRAM_BACKEND_LZO
73 config ZRAM_DEF_COMP_LZ4
75 depends on ZRAM_BACKEND_LZ4
77 config ZRAM_DEF_COMP_LZ4HC
79 depends on ZRAM_BACKEND_LZ4HC
81 config ZRAM_DEF_COMP_ZSTD
83 depends on ZRAM_BACKEND_ZSTD
85 config ZRAM_DEF_COMP_DEFLATE
87 depends on ZRAM_BACKEND_DEFLATE
89 config ZRAM_DEF_COMP_842
91 depends on ZRAM_BACKEND_842
97 default "lzo-rle" if ZRAM_DEF_COMP_LZORLE
98 default "lzo" if ZRAM_DEF_COMP_LZO
99 default "lz4" if ZRAM_DEF_COMP_LZ4
100 default "lz4hc" if ZRAM_DEF_COMP_LZ4HC
101 default "zstd" if ZRAM_DEF_COMP_ZSTD
102 default "deflate" if ZRAM_DEF_COMP_DEFLATE
103 default "842" if ZRAM_DEF_COMP_842
104 default "unset-value"
106 config ZRAM_WRITEBACK
107 bool "Write back incompressible or idle page to backing device"
110 This lets zram entries (incompressible or idle pages) be written
111 back to a backing device, helping save memory.
112 For this feature, admin should set up backing device via
113 /sys/block/zramX/backing_dev.
115 With /sys/block/zramX/{idle,writeback}, application could ask
116 idle page's writeback to the backing device to save in memory.
118 See Documentation/admin-guide/blockdev/zram.rst for more information.
120 config ZRAM_TRACK_ENTRY_ACTIME
121 bool "Track access time of zram entries"
124 With this feature zram tracks access time of every stored
125 entry (page), which can be used for a more fine grained IDLE
128 config ZRAM_MEMORY_TRACKING
129 bool "Track zRam block status"
130 depends on ZRAM && DEBUG_FS
131 select ZRAM_TRACK_ENTRY_ACTIME
133 With this feature, admin can track the state of allocated blocks
134 of zRAM. Admin could see the information via
135 /sys/kernel/debug/zram/zramX/block_state.
137 See Documentation/admin-guide/blockdev/zram.rst for more information.
139 config ZRAM_MULTI_COMP
140 bool "Enable multiple compression streams"
143 This will enable multi-compression streams, so that ZRAM can
144 re-compress pages using a potentially slower but more effective
145 compression algorithm. Note, that IDLE page recompression
146 requires ZRAM_TRACK_ENTRY_ACTIME.