Commit | Line | Data |
---|---|---|
b2441318 | 1 | # SPDX-License-Identifier: GPL-2.0 |
16a4bfb9 NG |
2 | config ZRAM |
3 | tristate "Compressed RAM block device support" | |
ebaf9ab5 | 4 | depends on BLOCK && SYSFS && ZSMALLOC && CRYPTO |
3d711a38 | 5 | depends on CRYPTO_LZO || CRYPTO_ZSTD || CRYPTO_LZ4 || CRYPTO_LZ4HC || CRYPTO_842 |
16a4bfb9 NG |
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 | ||
e7751617 | 15 | See Documentation/admin-guide/blockdev/zram.rst for more information. |
5a47074f | 16 | |
3d711a38 RS |
17 | choice |
18 | prompt "Default zram compressor" | |
19 | default ZRAM_DEF_COMP_LZORLE | |
20 | depends on ZRAM | |
21 | ||
22 | config ZRAM_DEF_COMP_LZORLE | |
23 | bool "lzo-rle" | |
24 | depends on CRYPTO_LZO | |
25 | ||
26 | config ZRAM_DEF_COMP_ZSTD | |
27 | bool "zstd" | |
28 | depends on CRYPTO_ZSTD | |
29 | ||
30 | config ZRAM_DEF_COMP_LZ4 | |
31 | bool "lz4" | |
32 | depends on CRYPTO_LZ4 | |
33 | ||
34 | config ZRAM_DEF_COMP_LZO | |
35 | bool "lzo" | |
36 | depends on CRYPTO_LZO | |
37 | ||
38 | config ZRAM_DEF_COMP_LZ4HC | |
39 | bool "lz4hc" | |
40 | depends on CRYPTO_LZ4HC | |
41 | ||
42 | config ZRAM_DEF_COMP_842 | |
43 | bool "842" | |
44 | depends on CRYPTO_842 | |
45 | ||
46 | endchoice | |
47 | ||
48 | config ZRAM_DEF_COMP | |
49 | string | |
50 | default "lzo-rle" if ZRAM_DEF_COMP_LZORLE | |
51 | default "zstd" if ZRAM_DEF_COMP_ZSTD | |
52 | default "lz4" if ZRAM_DEF_COMP_LZ4 | |
53 | default "lzo" if ZRAM_DEF_COMP_LZO | |
54 | default "lz4hc" if ZRAM_DEF_COMP_LZ4HC | |
55 | default "842" if ZRAM_DEF_COMP_842 | |
56 | ||
5a47074f | 57 | config ZRAM_WRITEBACK |
a939888e | 58 | bool "Write back incompressible or idle page to backing device" |
5a47074f | 59 | depends on ZRAM |
5a47074f MK |
60 | help |
61 | With incompressible page, there is no memory saving to keep it | |
62 | in memory. Instead, write it out to backing device. | |
63 | For this feature, admin should set up backing device via | |
64 | /sys/block/zramX/backing_dev. | |
65 | ||
a939888e MK |
66 | With /sys/block/zramX/{idle,writeback}, application could ask |
67 | idle page's writeback to the backing device to save in memory. | |
68 | ||
e7751617 | 69 | See Documentation/admin-guide/blockdev/zram.rst for more information. |
c0265342 MK |
70 | |
71 | config ZRAM_MEMORY_TRACKING | |
72 | bool "Track zRam block status" | |
73 | depends on ZRAM && DEBUG_FS | |
74 | help | |
75 | With this feature, admin can track the state of allocated blocks | |
76 | of zRAM. Admin could see the information via | |
77 | /sys/kernel/debug/zram/zramX/block_state. | |
78 | ||
e7751617 | 79 | See Documentation/admin-guide/blockdev/zram.rst for more information. |