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
98 default "lzo-rle" if ZRAM_DEF_COMP_LZORLE
99 default "lzo" if ZRAM_DEF_COMP_LZO
100 default "lz4" if ZRAM_DEF_COMP_LZ4
101 default "lz4hc" if ZRAM_DEF_COMP_LZ4HC
102 default "zstd" if ZRAM_DEF_COMP_ZSTD
103 default "deflate" if ZRAM_DEF_COMP_DEFLATE
104 default "842" if ZRAM_DEF_COMP_842
105 default "unset-value"
107 config ZRAM_WRITEBACK
108 bool "Write back incompressible or idle page to backing device"
111 This lets zram entries (incompressible or idle pages) be written
112 back to a backing device, helping save memory.
113 For this feature, admin should set up backing device via
114 /sys/block/zramX/backing_dev.
116 With /sys/block/zramX/{idle,writeback}, application could ask
117 idle page's writeback to the backing device to save in memory.
119 See Documentation/admin-guide/blockdev/zram.rst for more information.
121 config ZRAM_TRACK_ENTRY_ACTIME
122 bool "Track access time of zram entries"
125 With this feature zram tracks access time of every stored
126 entry (page), which can be used for a more fine grained IDLE
129 config ZRAM_MEMORY_TRACKING
130 bool "Track zRam block status"
131 depends on ZRAM && DEBUG_FS
132 select ZRAM_TRACK_ENTRY_ACTIME
134 With this feature, admin can track the state of allocated blocks
135 of zRAM. Admin could see the information via
136 /sys/kernel/debug/zram/zramX/block_state.
138 See Documentation/admin-guide/blockdev/zram.rst for more information.
140 config ZRAM_MULTI_COMP
141 bool "Enable multiple compression streams"
144 This will enable multi-compression streams, so that ZRAM can
145 re-compress pages using a potentially slower but more effective
146 compression algorithm. Note, that IDLE page recompression
147 requires ZRAM_TRACK_ENTRY_ACTIME.