From: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: SJ Park <sj@kernel.org>, Gao Xiang <xiang@kernel.org>,
Gao Xiang <hsiangkao@linux.alibaba.com>,
Michael Bommarito <michael.bommarito@gmail.com>,
Yue Hu <zbestahu@gmail.com>,
Jeffle Xu <jefflexu@linux.alibaba.com>,
Sandeep Dhavale <dhavale@google.com>,
Chunhai Guo <guochunhai@vivo.com>,
linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Chao Yu <chao@kernel.org>, Guenter Roeck <linux@roeck-us.net>,
David Hildenbrand <david@redhat.com>
Subject: Re: [PATCH v3] erofs: cap LZMA stream pool size
Date: Mon, 3 Aug 2026 11:12:49 +0200 [thread overview]
Message-ID: <anBYnPELPotUiNjv@monoceros> (raw)
In-Reply-To: <CAMuHMdWq1eutRM4u1Q3r50f8W4oSejo_XAgyjEKuwi4Lw6K7jQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2121 bytes --]
Hello,
On Mon, Aug 03, 2026 at 10:09:06AM +0200, Geert Uytterhoeven wrote:
> On Tue, 28 Jul 2026 at 08:55, SJ Park <sj@kernel.org> wrote:
> > I don't have a m68k testfarm, either. I'm doing crossbuild [1]. Hopefully you
> > could also reproduce it.
FTR, I don't have m68k hardware either, but as this is a build time
failure installing the Debian package gcc-m68k-linux-gnu and then doing
builds using
make ARCH=m68k CROSS_COMPILE=m68k-linux-gnu-
is good enough to reproduce the failure.
> I think you can reproduce some of the issues on most architectures
> with a non-SMP kernel, cfr. my reply[1] to Uwe's proposed fix.
> Unfortunately the Kconfig warning only shows up on architectures that
> don't define NR_CPUS (because they do not support SMP) at all,
> while ending up with zero streams is probably a runtime failure.
>
> [1] https://lore.kernel.org/CAMuHMdVGKX=3cfOrLWp1uSHX76xf1-=C0+GVCXkA8JTqNPg-ew@mail.gmail.com
I guess EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS should depend on SMP and
it's use should be conditionalized using something like
diff --git a/fs/erofs/decompressor_lzma.c b/fs/erofs/decompressor_lzma.c
index 6b0cdb446c6a..c00e94f8206f 100644
--- a/fs/erofs/decompressor_lzma.c
+++ b/fs/erofs/decompressor_lzma.c
@@ -50,9 +50,13 @@ static int __init z_erofs_lzma_init(void)
unsigned int i;
/* by default, use # of possible CPUs instead */
- if (!z_erofs_lzma_nstrms)
- z_erofs_lzma_nstrms = min_t(unsigned int, num_possible_cpus(),
- CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS);
+ if (!z_erofs_lzma_nstrms) {
+ if (IS_ENABLED(CONFIG_SMP))
+ z_erofs_lzma_nstrms = min_t(unsigned int, num_possible_cpus(),
+ CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS);
+ else
+ z_erofs_lzma_nstrms = 1;
+ }
for (i = 0; i < z_erofs_lzma_nstrms; ++i) {
struct z_erofs_lzma *strm = kzalloc_obj(*strm);
I played a bit with the definition of
EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS in fs/erofs/Kconfig, but didn't
find a way to define it that both uses NR_CPUS and doesn't generate a
warning with ARCH=m68k.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2026-08-03 9:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 11:47 [PATCH v3] erofs: cap LZMA stream pool size Michael Bommarito
2026-07-17 3:43 ` Gao Xiang
2026-07-21 3:44 ` Gao Xiang
2026-07-28 3:46 ` SJ Park
2026-07-28 6:31 ` Gao Xiang
2026-07-28 6:54 ` SJ Park
2026-08-03 8:09 ` Geert Uytterhoeven
2026-08-03 9:12 ` Uwe Kleine-König [this message]
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=anBYnPELPotUiNjv@monoceros \
--to=u.kleine-koenig@baylibre.com \
--cc=chao@kernel.org \
--cc=david@redhat.com \
--cc=dhavale@google.com \
--cc=geert@linux-m68k.org \
--cc=guochunhai@vivo.com \
--cc=hsiangkao@linux.alibaba.com \
--cc=jefflexu@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=michael.bommarito@gmail.com \
--cc=sj@kernel.org \
--cc=xiang@kernel.org \
--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