mm: Kconfig: simplify zswap configuration
- CONFIG_ZRAM: Zram is a user-facing feature, whereas zsmalloc is not. Don't make the user chase down a technical dependency like that, just select it in automatically when zram is requested. The CONFIG_CRYPTO dependency is redundant due to more specific deps. - CONFIG_ZPOOL: This is not a user-facing feature. Hide the symbol and have it selected in as needed. - CONFIG_ZSWAP: Select CRYPTO instead of depend. Common pattern. - Make the ZSWAP suboptions and their descriptions (compression, allocation backend) a bit more straight-forward for the user. Link: https://lkml.kernel.org/r/20220510152847.230957-5-hannes@cmpxchg.org Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Dan Streetman <ddstreet@ieee.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Roman Gushchin <guro@fb.com> Cc: Seth Jennings <sjenning@redhat.com> Cc: Shakeel Butt <shakeelb@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Родитель
519bcb7979
Коммит
b3fbd58fcb
|
@ -1,8 +1,9 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
config ZRAM
|
config ZRAM
|
||||||
tristate "Compressed RAM block device support"
|
tristate "Compressed RAM block device support"
|
||||||
depends on BLOCK && SYSFS && ZSMALLOC && CRYPTO
|
depends on BLOCK && SYSFS
|
||||||
depends on CRYPTO_LZO || CRYPTO_ZSTD || CRYPTO_LZ4 || CRYPTO_LZ4HC || CRYPTO_842
|
depends on CRYPTO_LZO || CRYPTO_ZSTD || CRYPTO_LZ4 || CRYPTO_LZ4HC || CRYPTO_842
|
||||||
|
select ZSMALLOC
|
||||||
help
|
help
|
||||||
Creates virtual block devices called /dev/zramX (X = 0, 1, ...).
|
Creates virtual block devices called /dev/zramX (X = 0, 1, ...).
|
||||||
Pages written to these disks are compressed and stored in memory
|
Pages written to these disks are compressed and stored in memory
|
||||||
|
|
55
mm/Kconfig
55
mm/Kconfig
|
@ -9,6 +9,9 @@ menu "Memory Management options"
|
||||||
config ARCH_NO_SWAP
|
config ARCH_NO_SWAP
|
||||||
bool
|
bool
|
||||||
|
|
||||||
|
config ZPOOL
|
||||||
|
bool
|
||||||
|
|
||||||
menuconfig SWAP
|
menuconfig SWAP
|
||||||
bool "Support for paging of anonymous memory (swap)"
|
bool "Support for paging of anonymous memory (swap)"
|
||||||
depends on MMU && BLOCK && !ARCH_NO_SWAP
|
depends on MMU && BLOCK && !ARCH_NO_SWAP
|
||||||
|
@ -21,8 +24,9 @@ menuconfig SWAP
|
||||||
|
|
||||||
config ZSWAP
|
config ZSWAP
|
||||||
bool "Compressed cache for swap pages (EXPERIMENTAL)"
|
bool "Compressed cache for swap pages (EXPERIMENTAL)"
|
||||||
depends on SWAP && CRYPTO=y
|
depends on SWAP
|
||||||
select FRONTSWAP
|
select FRONTSWAP
|
||||||
|
select CRYPTO
|
||||||
select ZPOOL
|
select ZPOOL
|
||||||
help
|
help
|
||||||
A lightweight compressed cache for swap pages. It takes
|
A lightweight compressed cache for swap pages. It takes
|
||||||
|
@ -38,8 +42,18 @@ config ZSWAP
|
||||||
they have not be fully explored on the large set of potential
|
they have not be fully explored on the large set of potential
|
||||||
configurations and workloads that exist.
|
configurations and workloads that exist.
|
||||||
|
|
||||||
|
config ZSWAP_DEFAULT_ON
|
||||||
|
bool "Enable the compressed cache for swap pages by default"
|
||||||
|
depends on ZSWAP
|
||||||
|
help
|
||||||
|
If selected, the compressed cache for swap pages will be enabled
|
||||||
|
at boot, otherwise it will be disabled.
|
||||||
|
|
||||||
|
The selection made here can be overridden by using the kernel
|
||||||
|
command line 'zswap.enabled=' option.
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "Compressed cache for swap pages default compressor"
|
prompt "Default compressor"
|
||||||
depends on ZSWAP
|
depends on ZSWAP
|
||||||
default ZSWAP_COMPRESSOR_DEFAULT_LZO
|
default ZSWAP_COMPRESSOR_DEFAULT_LZO
|
||||||
help
|
help
|
||||||
|
@ -105,7 +119,7 @@ config ZSWAP_COMPRESSOR_DEFAULT
|
||||||
default ""
|
default ""
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "Compressed cache for swap pages default allocator"
|
prompt "Default allocator"
|
||||||
depends on ZSWAP
|
depends on ZSWAP
|
||||||
default ZSWAP_ZPOOL_DEFAULT_ZBUD
|
default ZSWAP_ZPOOL_DEFAULT_ZBUD
|
||||||
help
|
help
|
||||||
|
@ -145,26 +159,9 @@ config ZSWAP_ZPOOL_DEFAULT
|
||||||
default "zsmalloc" if ZSWAP_ZPOOL_DEFAULT_ZSMALLOC
|
default "zsmalloc" if ZSWAP_ZPOOL_DEFAULT_ZSMALLOC
|
||||||
default ""
|
default ""
|
||||||
|
|
||||||
config ZSWAP_DEFAULT_ON
|
|
||||||
bool "Enable the compressed cache for swap pages by default"
|
|
||||||
depends on ZSWAP
|
|
||||||
help
|
|
||||||
If selected, the compressed cache for swap pages will be enabled
|
|
||||||
at boot, otherwise it will be disabled.
|
|
||||||
|
|
||||||
The selection made here can be overridden by using the kernel
|
|
||||||
command line 'zswap.enabled=' option.
|
|
||||||
|
|
||||||
config ZPOOL
|
|
||||||
tristate "Common API for compressed memory storage"
|
|
||||||
depends on ZSWAP
|
|
||||||
help
|
|
||||||
Compressed memory storage API. This allows using either zbud or
|
|
||||||
zsmalloc.
|
|
||||||
|
|
||||||
config ZBUD
|
config ZBUD
|
||||||
tristate "Low (Up to 2x) density storage for compressed pages"
|
tristate "2:1 compression allocator (zbud)"
|
||||||
depends on ZPOOL
|
depends on ZSWAP
|
||||||
help
|
help
|
||||||
A special purpose allocator for storing compressed pages.
|
A special purpose allocator for storing compressed pages.
|
||||||
It is designed to store up to two compressed pages per physical
|
It is designed to store up to two compressed pages per physical
|
||||||
|
@ -173,8 +170,8 @@ config ZBUD
|
||||||
density approach when reclaim will be used.
|
density approach when reclaim will be used.
|
||||||
|
|
||||||
config Z3FOLD
|
config Z3FOLD
|
||||||
tristate "Up to 3x density storage for compressed pages"
|
tristate "3:1 compression allocator (z3fold)"
|
||||||
depends on ZPOOL
|
depends on ZSWAP
|
||||||
help
|
help
|
||||||
A special purpose allocator for storing compressed pages.
|
A special purpose allocator for storing compressed pages.
|
||||||
It is designed to store up to three compressed pages per physical
|
It is designed to store up to three compressed pages per physical
|
||||||
|
@ -182,15 +179,13 @@ config Z3FOLD
|
||||||
still there.
|
still there.
|
||||||
|
|
||||||
config ZSMALLOC
|
config ZSMALLOC
|
||||||
tristate "Memory allocator for compressed pages"
|
tristate
|
||||||
|
prompt "N:1 compression allocator (zsmalloc)" if ZSWAP
|
||||||
depends on MMU
|
depends on MMU
|
||||||
help
|
help
|
||||||
zsmalloc is a slab-based memory allocator designed to store
|
zsmalloc is a slab-based memory allocator designed to store
|
||||||
compressed RAM pages. zsmalloc uses virtual memory mapping
|
pages of various compression levels efficiently. It achieves
|
||||||
in order to reduce fragmentation. However, this results in a
|
the highest storage density with the least amount of fragmentation.
|
||||||
non-standard allocator interface where a handle, not a pointer, is
|
|
||||||
returned by an alloc(). This handle must be mapped in order to
|
|
||||||
access the allocated space.
|
|
||||||
|
|
||||||
config ZSMALLOC_STAT
|
config ZSMALLOC_STAT
|
||||||
bool "Export zsmalloc statistics"
|
bool "Export zsmalloc statistics"
|
||||||
|
|
Загрузка…
Ссылка в новой задаче