OSDN Git Service

zram: Move default compression algorithm choice to Kconfig
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / drivers / block / zram / Kconfig
1 config ZRAM
2         tristate "Compressed RAM block device support"
3         depends on BLOCK && SYSFS && CRYPTO
4         select CRYPTO_LZ4
5         select ZPOOL
6         default n
7         help
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.
12
13           It has several use cases, for example: /tmp storage, use as swap
14           disks and maybe many more.
15
16           See Documentation/blockdev/zram.txt for more information.
17
18 config ZRAM_WRITEBACK
19        bool "Write back incompressible page to backing device"
20        depends on ZRAM
21        default n
22        help
23          With incompressible page, there is no memory saving to keep it
24          in memory. Instead, write it out to backing device.
25          For this feature, admin should set up backing device via
26          /sys/block/zramX/backing_dev.
27
28          See Documentation/blockdev/zram.txt for more information.
29
30 config ZRAM_MEMORY_TRACKING
31         bool "Track zRam block status"
32         depends on ZRAM && DEBUG_FS
33         help
34           With this feature, admin can track the state of allocated blocks
35           of zRAM. Admin could see the information via
36           /sys/kernel/debug/zram/zramX/block_state.
37
38           See Documentation/blockdev/zram.txt for more information.
39
40 config ZRAM_DEFAULT_COMP_ALGORITHM
41         string "Default ZRAM compression algorithm"
42         default "lz4"
43
44 if ZRAM
45
46 choice
47         prompt "Default zRAM compressed memory allocator"
48         default ZRAM_DEFAULT_ZSMALLOC
49         help
50           Select the compressed memory allocator that will be used by default
51           for all devices.
52
53         config ZRAM_DEFAULT_ZBUD
54                 bool "zbud"
55                 select ZBUD
56
57         config ZRAM_DEFAULT_Z3FOLD
58                 bool "z3fold"
59                 select Z3FOLD
60
61         config ZRAM_DEFAULT_ZSMALLOC
62                 bool "zsmalloc"
63                 select ZSMALLOC
64
65 endchoice
66
67 config ZRAM_DEFAULT_POOL
68         string
69         default "zbud" if ZRAM_DEFAULT_ZBUD
70         default "z3fold" if ZRAM_DEFAULT_Z3FOLD
71         default "zsmalloc" if ZRAM_DEFAULT_ZSMALLOC
72
73 endif