From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 921D344838B for ; Thu, 20 Aug 2026 12:51:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787230273; cv=none; b=bSRw6zjDmHRjkqmTl1sAX7uBwpXBNB4tjHgybBQ60xk+b9dECmxE3Wq+1ToRKgTcezFTNB6fjuwuQMoLcKxrJrH2qncXszCV99ukAG7fTrZhV6zVX4lrXkc/jcyFeMxFQ2xL14JLmpFpqc5cUY9h5JHCcHsjcZp8zsews0WlLmU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787230273; c=relaxed/simple; bh=Dtv9N5M3R3+npm9MWJ8p5P6RolLRe+JAHW7LAvuZaRo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=s43ejoReO8dvXMx267KYkq6ekfAapFIfBlivlMueR8qkQUlv0P2E0v6+97azfxDS3CLkAfp6T2MnAbkNKr5JglYhdwBk6qEDStYkT/0ova15DQ5CHIljzbdlK5lVB5jYE+dtqiMoDVg57Hyz26vInm+wyVR1xJDW4PhO5wYM2ZU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=d3NnJ4od; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d3NnJ4od" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2cace91f112so21212865ad.0 for ; Thu, 20 Aug 2026 05:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787230271; x=1787835071; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to:content-type; bh=Si7LMqQovUXrzcuAyjz5fRRdJxM8IdMb9TYKZNUROeI=; b=d3NnJ4odUcHd8hDJGZxYa2q8mdOX491LqyOyCC9YgdXxMMDw32LMxC/vt7Soxxzzsz OUIdd2Oe1/D6BR+6h6LjgiOK8hAPGbvO4/+PjCrdWG4RdAOVBLAZH9raHiKIfm24su30 mGQRWVm2vpnntZQ5DQ1tAEHmREHw388silag8B55C7+aCRTaFp0Ov3teEJvAjS/gVgaB VcqD440qe8WwTrvSUEw4+4jlx7YjFYlW69cSUz/Q2is254293lCUdBQ86fEX5Bv98egN P3YcHNy/9FbRZa1cAD9ufGqzoQ6EuHa6vn6aJPMhAIcgthNTIO+uhsgByHysUq4eFKdV vWtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787230271; x=1787835071; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:sender:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Si7LMqQovUXrzcuAyjz5fRRdJxM8IdMb9TYKZNUROeI=; b=o0jmxV5B/6Qfq99xnrEcjfA/Dni9+L/h2O34N5Li+da94uobqQqTZpTw13NLhX+gf7 Mx55P/cJzkjDR69gSZxFVUoZ0c9TZ4UMp5IiXziaIBYVWbDfFSe+xm/NyOi9bAzGyw/3 HAac7b7QSajim0UiXUjlo2kY4a3AnPhRpMj5vq46ojfDi4+ZhPVnDpznK4ADDGp+4C9k rEoCEOwvcZEFAm6m/G9YNoCzDTZzg+jAj+KtEEda23/7deru3EFVtdf/VY32CcSfG77X F6OlWqe72iG50eHUPrXay23R8/MqMhZva5QTVshpkrZ7ot2PorVo+YebnaAFnCGwA6s6 z0CQ== X-Forwarded-Encrypted: i=1; AHgh+RrJS6azhPxSWKKBAjp0SSVKlcoW22pKc1c323+6Pcd4JeSYZRRbnMEBDQ+uk3TjQY4Jc5HFlsgcLhcWa7Y=@vger.kernel.org X-Gm-Message-State: AFuF++nQjeSND/SseWB2XMMOgzVtlwUIlMWISOLwoPbSvG21Zw1x2uhA q17yPWdbH3Suma6FvEJwCtv0Smx05fcu/eRr0LuelrG9JdNRJ1/bDhp/ X-Gm-Gg: AR+sD12HcWELUO8/cXwlmCx08IbwUYjd7Sitv7K9pOR1/HOrIEfpvsH0iCQMErh+wmK bpaPMFxPDlU4LHW3SxOdSvi/vXIxcSRLP988GgBBQpNjOBgvOI7eMgW2rByv6oWwSGRFGaDiFFg JkyjWc4tXPpXn7x0qrQw51hj25Uhd5eBvo4hxqVKz8Aqkc4RpYtb+HGC8VtRQZp95xURD+40/2c sAs/iRnyVGEDYu1gTDU0A28/Pk0yCDOHv0Z3r4f4EbJ9qdUMd8YsTqjHxYHIAzsQ+UGXWsqgJ8a zG903j5arNO5ehnaZo5Xe6snId6/So1CyOJInjEVhgWcPokSbcN6phWYPM6GOnedDYcPuAcIdXS SfCfQiu7mnp/CCgehwigDR3bn2CPg5cxu5qt5jd92ZBpDPtw+6x2zhZehyjsDKk0CvrW3VhlJOY oRP3XD2DDmLpyRCorappHsqGJ2xNb6wB17vq7Dg6T7hsOEGR8N2i1Es8h4GcX5zJNnH+nDqtgIp g== X-Received: by 2002:a17:902:c94f:b0:2ca:e62c:9e96 with SMTP id d9443c01a7336-2d5fd6acbecmr225918805ad.5.1787230270659; Thu, 20 Aug 2026 05:51:10 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:da43:aeff:fecc:bfd5]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327bef3993dsm15590612eec.5.2026.08.20.05.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2026 05:51:09 -0700 (PDT) Sender: Guenter Roeck Date: Thu, 20 Aug 2026 05:51:08 -0700 From: Guenter Roeck To: Geert Uytterhoeven Cc: Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Sandeep Dhavale , Hongbo Li , Chunhai Guo , Michael Bommarito , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] erofs: Fix EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS default logic Message-ID: <3d845134-9b75-40bd-b221-2bd35f98d425@roeck-us.net> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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. > Absolutely agree. > Fixes: c9b47e6b23114e93 ("erofs: cap LZMA stream pool size") > Signed-off-by: Geert Uytterhoeven 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. > > 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 >= 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 >