From nobody Mon Sep 28 16:22:44 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22E9C39F16B for ; Thu, 20 Aug 2026 10:00:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787220031; cv=none; b=UjsM3rj8u1Y+TeS4MLi0d84V04qMCDiaqUQAZk6t5l2Ad6yDUhIb9acrh1epQVGZ4v7tJpz2YgiKKhL2DnGnFYIcTABnMfDCCYBuO0L7MW6fPZQisJzc3eal1rj8nZ+5s69KBzLV58qs6uJN4114DhvAYv3svQhi5ugKCvsGzE8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787220031; c=relaxed/simple; bh=PVvTnW1/MKpjNDZTLgNGYpn2PuCyyNdTPK7hYiGZjPI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jf3YPEBylJE4G37UATmtbTW06CrQ+tXjBqdhzoggYcElmnrADHqzECFI9+n3wOsuToVn8MKxFikdxdsAWd+3wRigWyjIqdkP3xsfxmuA8hGSPz1myL/sPfVkVkOOgVRkcJt6Dnkp0AudEjcB4qZIEzycMKFl2Cb4LVXKUxO7brA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5DC81F000E9; Thu, 20 Aug 2026 10:00:26 +0000 (UTC) From: Geert Uytterhoeven To: Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Sandeep Dhavale , Hongbo Li , Chunhai Guo , Michael Bommarito Cc: linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] erofs: Fix EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS default logic Date: Thu, 20 Aug 2026 12:00:23 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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=3D1 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 Reviewed-by: Chao Yu Reviewed-by: Guenter Roeck --- 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. =20 config EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS - int "EROFS LZMA default maximum decompression streams" + int "EROFS LZMA default maximum decompression streams" if SMP 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 >=3D 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. =20 - If unsure, keep the default of 16. + If unsure, keep the suggested default (16 or lower). =20 config EROFS_FS_ZIP_DEFLATE bool "EROFS DEFLATE compressed data support" --=20 2.43.0