LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Johannes Weiner <hannes@cmpxchg.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	kernel-team@fb.com, Seth Jennings <sjenning@redhat.com>,
	Dan Streetman <ddstreet@ieee.org>,
	Vitaly Wool <vitalywool@gmail.com>
Subject: Re: [PATCH 3/4] mm: Kconfig: simplify zswap configuration
Date: Tue, 24 Aug 2021 14:04:59 +0200	[thread overview]
Message-ID: <a4df6392-68b6-ef4f-2ace-78c16b59016a@suse.cz> (raw)
In-Reply-To: <20210819195533.211756-3-hannes@cmpxchg.org>

+CC zswap maintainers

On 8/19/21 21:55, Johannes Weiner wrote:
> Clean up option ordering; make prompts and help text more concise and
> actionable for non-developers; turn depends into selects where
> possible, so that users can simply select the functionality they want
> without having to chase down obscure code dependencies.
> 
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> ---
>  drivers/block/zram/Kconfig |  3 ++-
>  mm/Kconfig                 | 53 ++++++++++++++++++--------------------
>  2 files changed, 27 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/block/zram/Kconfig b/drivers/block/zram/Kconfig
> index 668c6bf2554d..e4163d4b936b 100644
> --- a/drivers/block/zram/Kconfig
> +++ b/drivers/block/zram/Kconfig
> @@ -1,8 +1,9 @@
>  # SPDX-License-Identifier: GPL-2.0
>  config ZRAM
>  	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
> +	select ZSMALLOC
>  	help
>  	  Creates virtual block devices called /dev/zramX (X = 0, 1, ...).
>  	  Pages written to these disks are compressed and stored in memory
> diff --git a/mm/Kconfig b/mm/Kconfig
> index dbceaa2a04a4..62c6e6092a0a 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -21,9 +21,13 @@ menuconfig SWAP
>  
>  if SWAP
>  
> +config ZPOOL
> +	bool
> +
>  config ZSWAP
>  	bool "Compressed cache for swap pages (EXPERIMENTAL)"
> -	depends on FRONTSWAP && CRYPTO=y
> +	select FRONTSWAP
> +	select CRYPTO
>  	select ZPOOL
>  	help
>  	  A lightweight compressed cache for swap pages.  It takes
> @@ -39,8 +43,18 @@ config ZSWAP
>  	  they have not be fully explored on the large set of potential
>  	  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
> -	prompt "Compressed cache for swap pages default compressor"
> +	prompt "Default compressor"
>  	depends on ZSWAP
>  	default ZSWAP_COMPRESSOR_DEFAULT_LZO
>  	help
> @@ -106,7 +120,7 @@ config ZSWAP_COMPRESSOR_DEFAULT
>         default ""
>  
>  choice
> -	prompt "Compressed cache for swap pages default allocator"
> +	prompt "Default allocator"
>  	depends on ZSWAP
>  	default ZSWAP_ZPOOL_DEFAULT_ZBUD
>  	help
> @@ -146,24 +160,9 @@ config ZSWAP_ZPOOL_DEFAULT
>         default "zsmalloc" if ZSWAP_ZPOOL_DEFAULT_ZSMALLOC
>         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"
> -	help
> -	  Compressed memory storage API.  This allows using either zbud or
> -	  zsmalloc.
> -
>  config ZBUD
> -	tristate "Low (Up to 2x) density storage for compressed pages"
> +	tristate "2:1 compression allocator (zbud)"
> +	depends on ZSWAP
>  	help
>  	  A special purpose allocator for storing compressed pages.
>  	  It is designed to store up to two compressed pages per physical
> @@ -172,8 +171,8 @@ config ZBUD
>  	  density approach when reclaim will be used.
>  
>  config Z3FOLD
> -	tristate "Up to 3x density storage for compressed pages"
> -	depends on ZPOOL
> +	tristate "3:1 compression allocator (z3fold)"
> +	depends on ZSWAP
>  	help
>  	  A special purpose allocator for storing compressed pages.
>  	  It is designed to store up to three compressed pages per physical
> @@ -181,15 +180,13 @@ config Z3FOLD
>  	  still there.
>  
>  config ZSMALLOC
> -	tristate "Memory allocator for compressed pages"
> +	tristate
> +	prompt "N:1 compression allocator (zsmalloc)" if ZSWAP
>  	depends on MMU
>  	help
>  	  zsmalloc is a slab-based memory allocator designed to store
> -	  compressed RAM pages.  zsmalloc uses virtual memory mapping
> -	  in order to reduce fragmentation.  However, this results in a
> -	  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.
> +	  pages of various compression levels efficiently. It achieves
> +	  the highest storage density with the least amount of fragmentation.
>  
>  config ZSMALLOC_STAT
>  	bool "Export zsmalloc statistics"
> 


  reply	other threads:[~2021-08-24 12:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 19:55 [PATCH 1/4] mm: Kconfig: move swap and slab config options to the MM section Johannes Weiner
2021-08-19 19:55 ` [PATCH 2/4] mm: Kconfig: group swap, slab, hotplug and thp options into submenus Johannes Weiner
2021-08-24 12:03   ` Vlastimil Babka
2021-08-24 14:56     ` Johannes Weiner
2021-08-19 19:55 ` [PATCH 3/4] mm: Kconfig: simplify zswap configuration Johannes Weiner
2021-08-24 12:04   ` Vlastimil Babka [this message]
2021-08-19 19:55 ` [PATCH 4/4] mm: zswap: add basic meminfo and vmstat coverage Johannes Weiner
2021-08-24 12:05   ` Vlastimil Babka
2021-08-30 18:04   ` kernel test robot
2021-08-30 18:49   ` Minchan Kim
2021-11-02 15:06     ` Johannes Weiner
2021-11-10 19:11       ` Minchan Kim
2021-08-24 11:47 ` [PATCH 1/4] mm: Kconfig: move swap and slab config options to the MM section Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a4df6392-68b6-ef4f-2ace-78c16b59016a@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=ddstreet@ieee.org \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sjenning@redhat.com \
    --cc=vitalywool@gmail.com \
    --subject='Re: [PATCH 3/4] mm: Kconfig: simplify zswap configuration' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).