linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kbuild@vger.kernel.org,  kernel test robot <lkp@intel.com>,
	Minchan Kim <minchan@kernel.org>,
	llvm@lists.linux.dev,  oe-kbuild-all@lists.linux.dev,
	 Linux Memory Management List <linux-mm@kvack.org>,
	linux-kernel@vger.kernel.org,  linux-block@vger.kernel.org,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH 08/14] zram: check that backends array has at least one backend
Date: Mon, 6 May 2024 14:20:37 +0900	[thread overview]
Message-ID: <CAK7LNARUBuR3gDtX6GfB7Zv6dydt1+qzBB_XT58wOg3WeCTVvA@mail.gmail.com> (raw)
In-Reply-To: <20240506032207.GD8623@google.com>

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


  reply	other threads:[~2024-05-06  5:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240503091823.3616962-9-senozhatsky@chromium.org>
2024-05-04  6:54 ` kernel test robot
2024-05-04  7:14   ` Sergey Senozhatsky
2024-05-04 23:10     ` Andrew Morton
2024-05-05  4:39       ` Sergey Senozhatsky
2024-05-05  5:13         ` Sergey Senozhatsky
2024-05-05  6:48           ` Sergey Senozhatsky
2024-05-06  3:22             ` Sergey Senozhatsky
2024-05-06  5:20               ` Masahiro Yamada [this message]
2024-05-06  6:43                 ` Sergey Senozhatsky
2024-05-04  7:15 ` kernel test robot

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=CAK7LNARUBuR3gDtX6GfB7Zv6dydt1+qzBB_XT58wOg3WeCTVvA@mail.gmail.com \
    --to=masahiroy@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=minchan@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=senozhatsky@chromium.org \
    /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