Re: [PATCH v3] erofs: cap LZMA stream pool size

Guenter Roeck <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.kbuild.devel
Message-ID <[email protected]>
On 8/12/26 03:54, Gao Xiang wrote:
> Hi Geert,
> 
> On Wed, Aug 12, 2026 at 11:30:14AM +0200, Geert Uytterhoeven wrote:
>> Hi Gao,
>>
>> On Wed, 12 Aug 2026 at 01:37, Gao Xiang <[email protected]> wrote:
>>> On Tue, Aug 11, 2026 at 03:37:38PM -0400, Michael Bommarito wrote:
>>>> On Tue, Aug 11, 2026 at 3:35 PM Guenter Roeck <[email protected]> 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 CPU.
>>
>> Thank you, that seems to work (despite still seeing the warning on m68k,
>> as NR_CPUS does not exist).
>>
> 
> ...
> 
>>
>>        $ make ARCH=m68k allmodconfig
>>       fs/erofs/Kconfig:137:warning: range is invalid
>>
>>   Warning...
>>
> 
> Yes, other arches shouldn't have the warning because I think other
> arches (including microblaze) defines NR_CPUS in Kconfig, except m68k.
> 

That is not entirely true. openrisc only has it if SMP=y. But it still
does not generate the warning for some reason.

> The following diff can eliminate the m68k warning above, I think m68k
> folks could consider this way if you really don't want to define an
> explicit NR_CPUS.  Anyway, I think it should go with another patch:
> 
> ```
> diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
> index 11835eb59d94..90499f126c73 100644
> --- a/arch/m68k/Kconfig
> +++ b/arch/m68k/Kconfig
> @@ -44,6 +44,9 @@ config M68K
>   	select UACCESS_MEMCPY if !MMU
>   	select ZONE_DMA
>   
> +config NR_CPUS
> +	int

I would suggest to add

	default 1

Guenter

> +
>   config CPU_BIG_ENDIAN
>   	def_bool y
> ```
> 
> I will try to form a formal patch (with the diff in the previous reply)
> directly to Linus (since I don't have other urgent patches for
> Linux 7.2.)
> 
> Thanks,
> Gao Xiang
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.