1 # SPDX-License-Identifier: GPL-2.0
3 tristate "Compressed RAM block device support"
4 depends on BLOCK && SYSFS && MMU
5 depends on CRYPTO_LZO || CRYPTO_ZSTD || CRYPTO_LZ4 || CRYPTO_LZ4HC || CRYPTO_842
8 Creates virtual block devices called /dev/zramX (X = 0, 1, ...).
9 Pages written to these disks are compressed and stored in memory
10 itself. These disks allow very fast I/O and compression provides
11 good amounts of memory savings.
13 It has several use cases, for example: /tmp storage, use as swap
14 disks and maybe many more.
16 See Documentation/admin-guide/blockdev/zram.rst for more information.
19 prompt "Default zram compressor"
20 default ZRAM_DEF_COMP_LZORLE
23 config ZRAM_DEF_COMP_LZORLE
27 config ZRAM_DEF_COMP_ZSTD
29 depends on CRYPTO_ZSTD
31 config ZRAM_DEF_COMP_LZ4
35 config ZRAM_DEF_COMP_LZO
39 config ZRAM_DEF_COMP_LZ4HC
41 depends on CRYPTO_LZ4HC
43 config ZRAM_DEF_COMP_842
51 default "lzo-rle" if ZRAM_DEF_COMP_LZORLE
52 default "zstd" if ZRAM_DEF_COMP_ZSTD
53 default "lz4" if ZRAM_DEF_COMP_LZ4
54 default "lzo" if ZRAM_DEF_COMP_LZO
55 default "lz4hc" if ZRAM_DEF_COMP_LZ4HC
56 default "842" if ZRAM_DEF_COMP_842
59 bool "Write back incompressible or idle page to backing device"
62 With incompressible page, there is no memory saving to keep it
63 in memory. Instead, write it out to backing device.
64 For this feature, admin should set up backing device via
65 /sys/block/zramX/backing_dev.
67 With /sys/block/zramX/{idle,writeback}, application could ask
68 idle page's writeback to the backing device to save in memory.
70 See Documentation/admin-guide/blockdev/zram.rst for more information.
72 config ZRAM_MEMORY_TRACKING
73 bool "Track zRam block status"
74 depends on ZRAM && DEBUG_FS
76 With this feature, admin can track the state of allocated blocks
77 of zRAM. Admin could see the information via
78 /sys/kernel/debug/zram/zramX/block_state.
80 See Documentation/admin-guide/blockdev/zram.rst for more information.