* Re: [PATCH 08/14] zram: check that backends array has at least one backend
[not found] ` <20240505051305.GB8623@google.com>
@ 2024-05-05 6:48 ` Sergey Senozhatsky
2024-05-06 3:22 ` Sergey Senozhatsky
0 siblings, 1 reply; 4+ messages in thread
From: Sergey Senozhatsky @ 2024-05-05 6:48 UTC (permalink / raw)
To: Andrew Morton, linux-kbuild
Cc: kernel test robot, Minchan Kim, llvm, oe-kbuild-all,
Linux Memory Management List, linux-kernel, linux-block,
Sergey Senozhatsky
On (24/05/05 14:13), Sergey Senozhatsky wrote:
> On (24/05/05 13:39), Sergey Senozhatsky wrote:
> [..]
> > > I guess just pick one if none were selected.
>
> How do I pick one if none were selected? Does Kconfig support
> something like that?
This triggers Kconfig error:
config ZRAM_EMPTY_BACKENDS_FIXUP
bool
depends on ZRAM && !ZRAM_BACKEND_LZO && !ZRAM_BACKEND_LZ4 && \
!ZRAM_BACKEND_LZ4HC && !ZRAM_BACKEND_ZSTD && \
!ZRAM_BACKEND_DEFLATE
select ZRAM_BACKEND_LZO
drivers/block/zram/Kconfig:17:error: recursive dependency detected!
drivers/block/zram/Kconfig:17: symbol ZRAM_BACKEND_LZO is selected by ZRAM_EMPTY_BACKENDS_FIXUP
drivers/block/zram/Kconfig:52: symbol ZRAM_EMPTY_BACKENDS_FIXUP depends on ZRAM_BACKEND_LZO
I'm a little surprised by this - EMPTY_BACKENDS_FIXUP does not depend
on ZRAM_BACKEND_LZO, it depends on NOT ZRAM_BACKEND_LZO.
Let me Cc linux-kbuild. Kbuild folks, how do I workaround this?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 08/14] zram: check that backends array has at least one backend
2024-05-05 6:48 ` [PATCH 08/14] zram: check that backends array has at least one backend Sergey Senozhatsky
@ 2024-05-06 3:22 ` Sergey Senozhatsky
2024-05-06 5:20 ` Masahiro Yamada
0 siblings, 1 reply; 4+ messages in thread
From: Sergey Senozhatsky @ 2024-05-06 3:22 UTC (permalink / raw)
To: Andrew Morton, linux-kbuild
Cc: kernel test robot, Minchan Kim, llvm, oe-kbuild-all,
Linux Memory Management List, linux-kernel, linux-block,
Sergey Senozhatsky
On (24/05/05 15:48), Sergey Senozhatsky wrote:
> On (24/05/05 14:13), Sergey Senozhatsky wrote:
> > On (24/05/05 13:39), Sergey Senozhatsky wrote:
> > [..]
> > > > I guess just pick one if none were selected.
> >
> > How do I pick one if none were selected? Does Kconfig support
> > something like that?
>
> This triggers Kconfig error:
>
> config ZRAM_EMPTY_BACKENDS_FIXUP
> bool
> depends on ZRAM && !ZRAM_BACKEND_LZO && !ZRAM_BACKEND_LZ4 && \
> !ZRAM_BACKEND_LZ4HC && !ZRAM_BACKEND_ZSTD && \
> !ZRAM_BACKEND_DEFLATE
> select ZRAM_BACKEND_LZO
>
>
> drivers/block/zram/Kconfig:17:error: recursive dependency detected!
> drivers/block/zram/Kconfig:17: symbol ZRAM_BACKEND_LZO is selected by ZRAM_EMPTY_BACKENDS_FIXUP
> drivers/block/zram/Kconfig:52: symbol ZRAM_EMPTY_BACKENDS_FIXUP depends on ZRAM_BACKEND_LZO
>
>
> I'm a little surprised by this - EMPTY_BACKENDS_FIXUP does not depend
> on ZRAM_BACKEND_LZO, it depends on NOT ZRAM_BACKEND_LZO.
>
> Let me Cc linux-kbuild. Kbuild folks, how do I workaround this?
Is this how one does it?
config ZRAM_BACKEND_LZO
bool "lzo and lzo-rle compression support"
depends on ZRAM
default y if !ZRAM_BACKEND_LZ4 && !ZRAM_BACKEND_LZ4HC && \
!ZRAM_BACKEND_ZSTD && !ZRAM_BACKEND_DEFLATE
default n
select LZO_COMPRESS
select LZO_DECOMPRESS
User still can select N and then we'll have empty backends, but
at least default is Y if none of the algorithms were selected.
Is it good enough?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 08/14] zram: check that backends array has at least one backend
2024-05-06 3:22 ` Sergey Senozhatsky
@ 2024-05-06 5:20 ` Masahiro Yamada
2024-05-06 6:43 ` Sergey Senozhatsky
0 siblings, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2024-05-06 5:20 UTC (permalink / raw)
To: Sergey Senozhatsky
Cc: Andrew Morton, linux-kbuild, kernel test robot, Minchan Kim, llvm,
oe-kbuild-all, Linux Memory Management List, linux-kernel,
linux-block, Arnd Bergmann
On Mon, May 6, 2024 at 12:22 PM Sergey Senozhatsky
<senozhatsky@chromium.org> wrote:
>
> On (24/05/05 15:48), Sergey Senozhatsky wrote:
> > On (24/05/05 14:13), Sergey Senozhatsky wrote:
> > > On (24/05/05 13:39), Sergey Senozhatsky wrote:
> > > [..]
> > > > > I guess just pick one if none were selected.
> > >
> > > How do I pick one if none were selected? Does Kconfig support
> > > something like that?
> >
> > This triggers Kconfig error:
> >
> > config ZRAM_EMPTY_BACKENDS_FIXUP
> > bool
> > depends on ZRAM && !ZRAM_BACKEND_LZO && !ZRAM_BACKEND_LZ4 && \
> > !ZRAM_BACKEND_LZ4HC && !ZRAM_BACKEND_ZSTD && \
> > !ZRAM_BACKEND_DEFLATE
> > select ZRAM_BACKEND_LZO
> >
> >
> > drivers/block/zram/Kconfig:17:error: recursive dependency detected!
> > drivers/block/zram/Kconfig:17: symbol ZRAM_BACKEND_LZO is selected by ZRAM_EMPTY_BACKENDS_FIXUP
> > drivers/block/zram/Kconfig:52: symbol ZRAM_EMPTY_BACKENDS_FIXUP depends on ZRAM_BACKEND_LZO
> >
> >
> > I'm a little surprised by this - EMPTY_BACKENDS_FIXUP does not depend
> > on ZRAM_BACKEND_LZO, it depends on NOT ZRAM_BACKEND_LZO.
> >
> > Let me Cc linux-kbuild. Kbuild folks, how do I workaround this?
>
> Is this how one does it?
>
> config ZRAM_BACKEND_LZO
> bool "lzo and lzo-rle compression support"
> depends on ZRAM
> default y if !ZRAM_BACKEND_LZ4 && !ZRAM_BACKEND_LZ4HC && \
> !ZRAM_BACKEND_ZSTD && !ZRAM_BACKEND_DEFLATE
> default n
> select LZO_COMPRESS
> select LZO_DECOMPRESS
>
>
> User still can select N and then we'll have empty backends, but
> at least default is Y if none of the algorithms were selected.
> Is it good enough?
I interpret this sentence into:
"randconfig will eventually disable all ZRAM_BACKEND_*,
causing the build error again.
Is it good enough, Arnd?"
Some possible solutions:
config ZRAM_BACKEND_FORCE_LZO
def_bool !ZRAM_BACKEND_LZ4 && !ZRAM_BACKEND_LZ4HC && \
!ZRAM_BACKEND_ZSTD && !ZRAM_BACKEND_DEFLATE
depends on ZRAM
select ZRAM_BACKEND_LZO
config ZRAM_BACKEND_LZO
bool "lzo and lzo-rle compression support"
depends on ZRAM
select LZO_COMPRESS
select LZO_DECOMPRESS
OR
config ZRAM_BACKEND_FORCE_LZO
def_bool !ZRAM_BACKEND_LZ4 && !ZRAM_BACKEND_LZ4HC && \
!ZRAM_BACKEND_ZSTD && !ZRAM_BACKEND_DEFLATE
config ZRAM_BACKEND_LZO
bool "lzo and lzo-rle compression support" if !ZRAM_BACKEND_FORCE_LZO
depends on ZRAM
default ZRAM_BACKEND_FORCE_LZO
select LZO_COMPRESS
select LZO_DECOMPRESS
BTW, "default n" you are adding are redundant.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 08/14] zram: check that backends array has at least one backend
2024-05-06 5:20 ` Masahiro Yamada
@ 2024-05-06 6:43 ` Sergey Senozhatsky
0 siblings, 0 replies; 4+ messages in thread
From: Sergey Senozhatsky @ 2024-05-06 6:43 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Sergey Senozhatsky, Andrew Morton, linux-kbuild,
kernel test robot, Minchan Kim, llvm, oe-kbuild-all,
Linux Memory Management List, linux-kernel, linux-block,
Arnd Bergmann
On (24/05/06 14:20), Masahiro Yamada wrote:
> config ZRAM_BACKEND_FORCE_LZO
> def_bool !ZRAM_BACKEND_LZ4 && !ZRAM_BACKEND_LZ4HC && \
> !ZRAM_BACKEND_ZSTD && !ZRAM_BACKEND_DEFLATE
>
> config ZRAM_BACKEND_LZO
> bool "lzo and lzo-rle compression support" if !ZRAM_BACKEND_FORCE_LZO
> depends on ZRAM
> default ZRAM_BACKEND_FORCE_LZO
> select LZO_COMPRESS
> select LZO_DECOMPRESS
I'll take this one. Thank you.
> BTW, "default n" you are adding are redundant.
OK.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-05-06 6:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20240503091823.3616962-9-senozhatsky@chromium.org>
[not found] ` <202405041440.UTBQZAaf-lkp@intel.com>
[not found] ` <20240504071416.GH14947@google.com>
[not found] ` <20240504161004.f5a0aab5e5aa1033d4696c20@linux-foundation.org>
[not found] ` <20240505043957.GA8623@google.com>
[not found] ` <20240505051305.GB8623@google.com>
2024-05-05 6:48 ` [PATCH 08/14] zram: check that backends array has at least one backend Sergey Senozhatsky
2024-05-06 3:22 ` Sergey Senozhatsky
2024-05-06 5:20 ` Masahiro Yamada
2024-05-06 6:43 ` Sergey Senozhatsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox