mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gao Xiang <xiang@kernel.org>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Gao Xiang <xiang@kernel.org>, Chao Yu <chao@kernel.org>,
	Yue Hu <zbestahu@gmail.com>,
	Jeffle Xu <jefflexu@linux.alibaba.com>,
	Sandeep Dhavale <dhavale@google.com>,
	Hongbo Li <hongbohbli@tencent.com>,
	Chunhai Guo <guochunhai@vivo.com>,
	Michael Bommarito <michael.bommarito@gmail.com>,
	linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] erofs: Fix EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS default logic
Date: Thu, 20 Aug 2026 20:56:39 +0800	[thread overview]
Message-ID: <aob5h3hi8W0CKxXr@XiangdeMacBook-Pro.local> (raw)
In-Reply-To: <c480ed6b8bf38822263e2c5b7cf32b28600f212d.1787219898.git.geert+renesas@glider.be>

Hi Geert,

On Thu, Aug 20, 2026 at 12:00:23PM +0200, Geert Uytterhoeven wrote:
> When NR_CPUS is less than 16, or when SMP is disabled, the default value
> of 16 is invalid.
> 
> While actual configuration picks up a sensible and valid default
> (NR_CPUS or 1), "make savedefconfig" will still write a line like
> 
>     CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS=1
> 
> to the defconfig file, even if that matches the sensible default.
> 
> Avoid needlessly enlarging the defconfig files, and reduce churn for
> updating them, by specifying valid defaults depending on SMP and
> NR_CPUS.
> 
> While at it, make the prompt depend on SMP, as there is no point in
> asking the user about the maximum number of decompression streams if
> there is only one valid answer.
> 
> Fixes: c9b47e6b23114e93 ("erofs: cap LZMA stream pool size")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>  fs/erofs/Kconfig | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/erofs/Kconfig b/fs/erofs/Kconfig
> index 2dfc313588d283a0..37495e95a78d9bf6 100644
> --- a/fs/erofs/Kconfig
> +++ b/fs/erofs/Kconfig
> @@ -132,11 +132,13 @@ config EROFS_FS_ZIP_LZMA
>  	  Say N if you want to disable LZMA compression support.
>  
>  config EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS
> -	int "EROFS LZMA default maximum decompression streams"
> +	int "EROFS LZMA default maximum decompression streams" if SMP

As I said, if NR_CPUS is meaningful for both SMP or !SMP, there should
not be SMP involved in this Kconfig.

In other words, if SMP below is just a workaround since some arches
leave NR_CPUS = 0 if !SMP.  If NR_CPUS is valid unconditionally, I don't
think SMP is at all useful here.

Could you just drop if SMP and leave this configuration unconditionally
shown for users? It's easy for all users to get how this Kconfig works.

Thanks,
Gao Xiang

>  	depends on EROFS_FS_ZIP_LZMA
>  	range 1 NR_CPUS if SMP
>  	range 1 1 if !SMP
> -	default 16
> +	default 16 if SMP && NR_CPUS >= 16
> +	default NR_CPUS if SMP
> +	default 1
>  	help
>  	  By default EROFS allocates one LZMA decompression stream per CPU.
>  	  Each stream can hold a dictionary of up to 8 MiB taken from the
> @@ -144,7 +146,7 @@ config EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS
>  	  of memory.  This caps the default; the lzma_streams module parameter
>  	  still overrides it.
>  
> -	  If unsure, keep the default of 16.
> +	  If unsure, keep the suggested default (16 or lower).
>  
>  config EROFS_FS_ZIP_DEFLATE
>  	bool "EROFS DEFLATE compressed data support"
> -- 
> 2.43.0
> 
> 

  parent reply	other threads:[~2026-08-20 12:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20 10:00 Geert Uytterhoeven
2026-08-20 10:15 ` Geert Uytterhoeven
2026-08-28 15:34   ` Nicolas Schier
2026-08-28 17:21     ` Geert Uytterhoeven
2026-08-28 19:20       ` Nicolas Schier
2026-08-28 23:19         ` Julian Braha
2026-08-31 12:40           ` Geert Uytterhoeven
2026-08-20 12:51 ` Guenter Roeck
2026-08-20 13:10   ` Gao Xiang
2026-08-20 13:43     ` Guenter Roeck
2026-08-20 14:20       ` Gao Xiang
2026-08-20 12:56 ` Gao Xiang [this message]
2026-08-20 14:20   ` Geert Uytterhoeven
2026-08-24  0:43 ` Chao Yu

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=aob5h3hi8W0CKxXr@XiangdeMacBook-Pro.local \
    --to=xiang@kernel.org \
    --cc=chao@kernel.org \
    --cc=dhavale@google.com \
    --cc=geert+renesas@glider.be \
    --cc=guochunhai@vivo.com \
    --cc=hongbohbli@tencent.com \
    --cc=jefflexu@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.bommarito@gmail.com \
    --cc=zbestahu@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®