From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vs1-f51.google.com (mail-vs1-f51.google.com [209.85.217.51]) (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 182E740DB56 for ; Wed, 12 Aug 2026 09:30:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527031; cv=none; b=UG1kTmht+PhYLAi7sOFrrcmo0IDBC/D8AzyZtJtWSJaWZ3kTAsTgSLcnF6x7XswW78mNjcWgOSHIhHAWciAJneWmNwp3fmZ8sipZXIONm2bwl4/gwEkINGa0csRqUqmrxqs01VeCZiyWb/6g98IlNvkQf5MgDVpzZPHVgXR9YxE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527031; c=relaxed/simple; bh=mb1vwLfGnoz/AiE/5mRjeVCRWWyUDyrnEFQJJPGmlE8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=r5Lc9R9lY9eiOr0oePxAuq6tThliqbHnSWe3KYiCiXyU+ydme/ucVGhcyKaU9JeWuczNMIXZDTPSqYnWGewCLPStK2xd3i7k0gtLK1zsRygEzUn8lWzZey/ZDqSMJRAZZglj1I/OL0a6ugF5+L8XW1Mu6Yv+VUIlnElauBdwQSk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.217.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vs1-f51.google.com with SMTP id ada2fe7eead31-7473e927969so187148137.3 for ; Wed, 12 Aug 2026 02:30:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786527028; x=1787131828; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=HsKpew/NpbmRwJwh6JVQkfOwogDxzHNyZba/zwHTTH0=; b=qOBvRJjhRLw4rt7WvE6TOwGVuiodotMphTk14ySHboQL2HpvB9J9KQg9hFxm/8KybW SGGxftAQZta20LmqCCdcGEJThY2+4m5Ah9qA5zqVuwnGoL9FKIW7OnHOA+mjKtS/sYU/ 1PbkGw66o6PBvgVp3RMFhQMTxzgk/a/XrdV0joERWfXE+cWHwMsngvJEif5JwCJ+QaRk PPJdA7ONJaS9O4YfAAfE7frTOXfZB7POl0CH1vJwAt+Zqofb6qkErEVNrLfV2BDNxDMJ 4950JvXED1II8/RfaGBzDr4zcGT1lct2z381/6EXI/9LZpO1bEwRMYTHEpyD3pCdV79b WVKA== X-Forwarded-Encrypted: i=1; AHgh+Rrc3/Qe4JiK9DnEsWYvp8mYfqS/TGUg7Chgpw86rjrVqg4U/HpvgnDfywgf1XcY/op/rfYHfdXh9H2CFko=@vger.kernel.org X-Gm-Message-State: AOJu0Yz47Z3oNaCxLEiYsTrL5dEcyZww2Ees1vDUJknZ1enfPjnwWiVZ S7W2S8hnFS8PLuC17g4BNsRLFrUyX92PTWBcobRY+eVgZNY4G47kDm+5j5a92/bs X-Gm-Gg: AR+sD13PEAN3BYTU68bPLX9oA+BOyfTEIkOcUB6a674JD0X8kt2/BOnur6RLBV7NEN8 Bfm373PJZAn71ikf7I2xqjNFMWX+xX7QJUzvUBkRmx10t/jvhdlzfFp5c7biFZjDJaJRSre0Hup USZ5UdDaeBkLovz3m8hhNdg4yen8/3oknGcszhw9FiO59nuRd++S/1zr00E0wSRXExlEScrvJvw DtoHO/cE7TvPShsJ6xL43hVKidVivXQzeNsk0K1lXegaqMr7mFoWvYbigMK5CW66h7Ro5uDn0Pv ig0mbHipxPEQDGvrHCHMRVAXjAGoJT26EU1tLvuBktDRv/Ozuae0GEG6hplXm5huxGHDx0r0ZVF Hb6d+BBz5EhViku8XT2EPiDDKfR2MAjw17Mjlj5tmV+yVCpAlgQoK51lktn6BHctXJ6fDh3DQbg 1P3iwHTFHf/htVaPxJVVUY5Rhj5JAUqRI+wNB5XLl5qIbyVpymgfn0v0JQBCYZWlce/XF1WNkQU T7hMwgQGtlrQVICwCiKolWH7qDc/nQr5Hri X-Received: by 2002:a05:6102:1621:b0:739:626d:4473 with SMTP id ada2fe7eead31-76c83e24c17mr761412137.0.1786527027721; Wed, 12 Aug 2026 02:30:27 -0700 (PDT) Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com. [209.85.217.48]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-5c45b4c2fe9sm971681e0c.5.2026.08.12.02.30.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Aug 2026 02:30:26 -0700 (PDT) Received: by mail-vs1-f48.google.com with SMTP id ada2fe7eead31-75e2905c09aso150870137.2 for ; Wed, 12 Aug 2026 02:30:26 -0700 (PDT) X-Forwarded-Encrypted: i=1; AHgh+RqWJ0QqRE2gWFWri4mlBXjE00YnWskGHNSqdZWxZLZ37PKVnO/oNgYYZYtNol/9s7MHZvbm4ZuX0GcbK8Y=@vger.kernel.org X-Received: by 2002:a05:6102:3c87:b0:737:f0ba:508f with SMTP id ada2fe7eead31-76c87872117mr743103137.3.1786527025984; Wed, 12 Aug 2026 02:30:25 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260728065447.91511-1-sj@kernel.org> <87853c96-cc8f-49e6-81b1-02bfe409e372@roeck-us.net> In-Reply-To: From: Geert Uytterhoeven Date: Wed, 12 Aug 2026 11:30:14 +0200 X-Gmail-Original-Message-ID: X-Gm-Features: AUfX_mxA9clRzUNdd2GP67STTBu3d3CfSgby0ufuk5IkGAlxaBZE-BZi7BRVSMc Message-ID: Subject: Re: [PATCH v3] erofs: cap LZMA stream pool size To: Gao Xiang Cc: Guenter Roeck , Michael Bommarito , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , SJ Park , Gao Xiang , Yue Hu , Jeffle Xu , Sandeep Dhavale , Chunhai Guo , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, Chao Yu , David Hildenbrand , linux-kbuild Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Gao, On Wed, 12 Aug 2026 at 01:37, Gao Xiang wrote: > On Tue, Aug 11, 2026 at 03:37:38PM -0400, Michael Bommarito wrote: > > On Tue, Aug 11, 2026 at 3:35=E2=80=AFPM Guenter Roeck wrote: > > > > Any progress with fixing this for v7.2? > > > > I would like to fix this since I started the problem with the original > > patch, but I feel a bit stuck. My v1 and v2 patches would not have > > triggered the build failure, but Gao made valid points about the > > trade-offs that led us to this v3. Maybe it would be worth your > > opinion on the config approach in those earlier patches? > > Sorry about the late reply. > > As I said, I really dislike hardcoded range, but it is an issue that no > NR_CPUS definition on CONFIG_SMP: > > I wonder if the following diff resolves the m68k issue (I'm not an > Kconfig expert but it seems to work on x86_64 !CONFIG_SMP): > > diff --git a/fs/erofs/Kconfig b/fs/erofs/Kconfig > index 8ca1767dafb6..2dfc313588d2 100644 > --- a/fs/erofs/Kconfig > +++ b/fs/erofs/Kconfig > @@ -134,7 +134,8 @@ config EROFS_FS_ZIP_LZMA > config EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS > int "EROFS LZMA default maximum decompression streams" > depends on EROFS_FS_ZIP_LZMA > - range 1 NR_CPUS > + range 1 NR_CPUS if SMP > + range 1 1 if !SMP > default 16 > help > By default EROFS allocates one LZMA decompression stream per CP= U. Thank you, that seems to work (despite still seeing the warning on m68k, as NR_CPUS does not exist). Test runs on ARM (NR_CPUS depends on SMP, like most architectures), m68k (no CONFIG_NR_CPUS), and x86 (NR_CPUS is always defined) before/after: $ make ARCH=3Darm allmodconfig $ grep CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS .config CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS=3D4 SMP is OK. $ sed -i "/CONFIG_SMP=3Dy/d" .config $ yes "" | make ARCH=3Darm oldconfig - -No warning... - $ grep CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS .config - CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS=3D0 + CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS=3D1 -... but automatic configuration is silently broken on UP. +UP is OK with automatic configuration. $ sed -i "/CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS.*/d" .config $ yes "" | make ARCH=3Darm oldconfig - EROFS LZMA default maximum decompression streams (EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS) [0] (NEW) - [infinite loop] + $ grep CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS .config + CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS=3D1 -Manual configuration is broken. +UP is OK with manual configuration. --------------------------------------------------------------------------= ------ $ make ARCH=3Dm68k allmodconfig fs/erofs/Kconfig:137:warning: range is invalid Warning... $ grep CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS .config - CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS=3DNR_CPUS - -... but this will actually build and work, as has: - - #ifndef CONFIG_NR_CPUS - /* FIXME: This should be fixed in the arch's Kconfig */ - #define CONFIG_NR_CPUS 1 - #endif - - /* Places which use this should consider cpumask_var_t. */ - #define NR_CPUS CONFIG_NR_CPUS + CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS=3D1 + +... but UP is OK with automatic configuration. $ sed -i "/CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS.*/d" .config $ yes "" | make ARCH=3Dm68k oldconfig - EROFS LZMA default maximum decompression streams (EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS) [NR_CPUS] (NEW) - [infinite loop] + fs/erofs/Kconfig:137:warning: range is invalid + +Warning... + + $ grep CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS .config + CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS=3D1 -Manual configuration is broken. +... but UP is OK with manual configuration. --------------------------------------------------------------------------= ------ $ make ARCH=3Dx86 allmodconfig $ grep CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS .config CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS=3D16 SMP is OK. $ sed -i "/CONFIG_SMP=3Dy/d" .config $ yes "" | make ARCH=3Dx86 oldconfig $ grep CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS .config CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS=3D1 UP is OK with automatic configuration. $ sed -i "/CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS.*/d" .config $ yes "" | make ARCH=3Dx86 oldconfig $ grep CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS .config CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS=3D1 UP is OK with manual configuration. Gr{oetje,eeting}s, Geert --=20 Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k= .org In personal conversations with technical people, I call myself a hacker. Bu= t when I'm talking to journalists I just say "programmer" or something like t= hat. -- Linus Torvalds