linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] init/Kconfig: fix unmet direct dependencies
@ 2022-09-28  6:49 Ren Zhijie
  2022-09-28  7:01 ` Sebastian Andrzej Siewior
  2022-09-28  7:12 ` Lukas Bulwahn
  0 siblings, 2 replies; 9+ messages in thread
From: Ren Zhijie @ 2022-09-28  6:49 UTC (permalink / raw)
  To: akpm, ndesaulniers, nathan, vbabka, masahiroy, arnd, bigeasy,
	seanjc, hannes, ojeda, mhiramat, dmitry.torokhov, atomlin, ddiss,
	christophe.leroy, lukas.bulwahn
  Cc: linux-kernel, Ren Zhijie

Commit 3c07bfce92a5 ("proc: make config PROC_CHILDREN depend on PROC_FS") 
make config PROC_CHILDREN depend on PROC_FS.

When CONFIG_PROC_FS is not set and CONFIG_CHECKPOINT_RESTORE=y,
make menuconfig screams like this:

WARNING: unmet direct dependencies detected for PROC_CHILDREN
  Depends on [n]: PROC_FS [=n]
  Selected by [y]:
  - CHECKPOINT_RESTORE [=y]

So add PROC_FS to dependencies to fix this.
Fixes: 3c07bfce92a5 ("proc: make config PROC_CHILDREN depend on PROC_FS")
Signed-off-by: Ren Zhijie <renzhijie2@huawei.com>
---
 init/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/init/Kconfig b/init/Kconfig
index e11307310fc1..fc32b28fe93e 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1273,6 +1273,7 @@ endif # NAMESPACES
 
 config CHECKPOINT_RESTORE
 	bool "Checkpoint/restore support"
+	select PROC_FS
 	select PROC_CHILDREN
 	select KCMP
 	default n
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH -next] init/Kconfig: fix unmet direct dependencies
  2022-09-28  6:49 [PATCH -next] init/Kconfig: fix unmet direct dependencies Ren Zhijie
@ 2022-09-28  7:01 ` Sebastian Andrzej Siewior
  2022-09-28  7:20   ` Lukas Bulwahn
  2022-09-28  7:12 ` Lukas Bulwahn
  1 sibling, 1 reply; 9+ messages in thread
From: Sebastian Andrzej Siewior @ 2022-09-28  7:01 UTC (permalink / raw)
  To: Ren Zhijie
  Cc: akpm, ndesaulniers, nathan, vbabka, masahiroy, arnd, seanjc,
	hannes, ojeda, mhiramat, dmitry.torokhov, atomlin, ddiss,
	christophe.leroy, lukas.bulwahn, linux-kernel

On 2022-09-28 06:49:34 [+0000], Ren Zhijie wrote:
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1273,6 +1273,7 @@ endif # NAMESPACES
>  
>  config CHECKPOINT_RESTORE
>  	bool "Checkpoint/restore support"
> +	select PROC_FS

Couldn't this become a depends?

>  	select PROC_CHILDREN
>  	select KCMP
>  	default n

Sebastian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH -next] init/Kconfig: fix unmet direct dependencies
  2022-09-28  6:49 [PATCH -next] init/Kconfig: fix unmet direct dependencies Ren Zhijie
  2022-09-28  7:01 ` Sebastian Andrzej Siewior
@ 2022-09-28  7:12 ` Lukas Bulwahn
  1 sibling, 0 replies; 9+ messages in thread
From: Lukas Bulwahn @ 2022-09-28  7:12 UTC (permalink / raw)
  To: Ren Zhijie
  Cc: akpm, ndesaulniers, nathan, vbabka, masahiroy, arnd, bigeasy,
	seanjc, hannes, ojeda, mhiramat, dmitry.torokhov, atomlin, ddiss,
	christophe.leroy, linux-kernel

On Wed, Sep 28, 2022 at 8:53 AM Ren Zhijie <renzhijie2@huawei.com> wrote:
>
> Commit 3c07bfce92a5 ("proc: make config PROC_CHILDREN depend on PROC_FS")
> make config PROC_CHILDREN depend on PROC_FS.
>
> When CONFIG_PROC_FS is not set and CONFIG_CHECKPOINT_RESTORE=y,
> make menuconfig screams like this:
>
> WARNING: unmet direct dependencies detected for PROC_CHILDREN
>   Depends on [n]: PROC_FS [=n]
>   Selected by [y]:
>   - CHECKPOINT_RESTORE [=y]
>
> So add PROC_FS to dependencies to fix this.
> Fixes: 3c07bfce92a5 ("proc: make config PROC_CHILDREN depend on PROC_FS")
> Signed-off-by: Ren Zhijie <renzhijie2@huawei.com>

This patch here makes sense.

Just some minor addition:

The commit  3c07bfce92a5 ("proc: make config PROC_CHILDREN depend on
PROC_FS") is not really broken, but just made the implicit
dependencies much more explicit and hence now this warning from
menuconfig indicates that.

Before the commit 3c07bfce92a5 ("proc: make config PROC_CHILDREN
depend on PROC_FS"):

When CONFIG_PROC_FS is not set and CONFIG_CHECKPOINT_RESTORE=y, then
the feature of CONFIG_CHECKPOINT_RESTORE would just not worked (as
this would not be any proc fs, and no "proc children" functionality.)

After the commit 3c07bfce92a5 ("proc: make config PROC_CHILDREN depend
on PROC_FS"):

When CONFIG_PROC_FS is not set and CONFIG_CHECKPOINT_RESTORE=y, it
warns to add PROC_FS to assist in configuring something that makes the
feature of CONFIG_CHECKPOINT_RESTORE work.

So this patch is yet another improvement to what the commit
3c07bfce92a5 ("proc: make config PROC_CHILDREN depend on PROC_FS")
already partially improved. However, feel free to keep the Fixes-tag
in this patch, as this patch certainly improves handling of what the
commit 3c07bfce92a5 started improving.

Reviewed-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>

The recipient list is a bit "random" (coincidental). You could have
probably just sent this patch to Andrew Morton, me and linux-kernel
mailing list.

Lukas

> ---
>  init/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/init/Kconfig b/init/Kconfig
> index e11307310fc1..fc32b28fe93e 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1273,6 +1273,7 @@ endif # NAMESPACES
>
>  config CHECKPOINT_RESTORE
>         bool "Checkpoint/restore support"
> +       select PROC_FS
>         select PROC_CHILDREN
>         select KCMP
>         default n
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH -next] init/Kconfig: fix unmet direct dependencies
  2022-09-28  7:01 ` Sebastian Andrzej Siewior
@ 2022-09-28  7:20   ` Lukas Bulwahn
  2022-09-28  7:52     ` Ren Zhijie
  2022-09-28  9:14     ` Sebastian Andrzej Siewior
  0 siblings, 2 replies; 9+ messages in thread
From: Lukas Bulwahn @ 2022-09-28  7:20 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: Ren Zhijie, akpm, ndesaulniers, nathan, vbabka, masahiroy, arnd,
	seanjc, hannes, ojeda, mhiramat, dmitry.torokhov, atomlin, ddiss,
	christophe.leroy, linux-kernel

On Wed, Sep 28, 2022 at 9:01 AM Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
>
> On 2022-09-28 06:49:34 [+0000], Ren Zhijie wrote:
> > --- a/init/Kconfig
> > +++ b/init/Kconfig
> > @@ -1273,6 +1273,7 @@ endif # NAMESPACES
> >
> >  config CHECKPOINT_RESTORE
> >       bool "Checkpoint/restore support"
> > +     select PROC_FS
>
> Couldn't this become a depends?
>

It could also be a depends (to resolve the warning).

It is just the question whether:

When PROC_FS is not set, should the CHECKPOINT_RESTORE still be
visible as a config option to add (and then automatically add
PROC_FS)? Then select is right here.

or:

When PROC_FS is not set, should the CHECKPOINT_RESTORE not be visible
as a config option to add? Instead the user first needs to add
PROC_FS, then CHECKPOINT_RESTORE becomes visible as an option to add,
and then the user can add it. Then depends would be right.

For me, both seem reasonable. So, I assume Ren considered select the
better choice.

But maybe Ren can confirm.

A kernel build configuration without PROC_FS is quite special
anyway... and then being interested in CHECKPOINT_ RESTORE for such a
system is really really special. I wonder if that user then really
knows what he or she is configuring at that point.


Lukas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH -next] init/Kconfig: fix unmet direct dependencies
  2022-09-28  7:20   ` Lukas Bulwahn
@ 2022-09-28  7:52     ` Ren Zhijie
  2022-09-28  9:14     ` Sebastian Andrzej Siewior
  1 sibling, 0 replies; 9+ messages in thread
From: Ren Zhijie @ 2022-09-28  7:52 UTC (permalink / raw)
  To: Lukas Bulwahn, Sebastian Andrzej Siewior
  Cc: akpm, ndesaulniers, nathan, vbabka, masahiroy, arnd, seanjc,
	hannes, ojeda, mhiramat, dmitry.torokhov, atomlin, ddiss,
	christophe.leroy, linux-kernel


在 2022/9/28 15:20, Lukas Bulwahn 写道:
> On Wed, Sep 28, 2022 at 9:01 AM Sebastian Andrzej Siewior
> <bigeasy@linutronix.de> wrote:
>> On 2022-09-28 06:49:34 [+0000], Ren Zhijie wrote:
>>> --- a/init/Kconfig
>>> +++ b/init/Kconfig
>>> @@ -1273,6 +1273,7 @@ endif # NAMESPACES
>>>
>>>   config CHECKPOINT_RESTORE
>>>        bool "Checkpoint/restore support"
>>> +     select PROC_FS
>> Couldn't this become a depends?
>>
> It could also be a depends (to resolve the warning).
>
> It is just the question whether:
>
> When PROC_FS is not set, should the CHECKPOINT_RESTORE still be
> visible as a config option to add (and then automatically add
> PROC_FS)? Then select is right here.
>
> or:
>
> When PROC_FS is not set, should the CHECKPOINT_RESTORE not be visible
> as a config option to add? Instead the user first needs to add
> PROC_FS, then CHECKPOINT_RESTORE becomes visible as an option to add,
> and then the user can add it. Then depends would be right.
>
> For me, both seem reasonable. So, I assume Ren considered select the
> better choice.
>
> But maybe Ren can confirm.

My consider is that if CHECKPOINT_RESTORE depends on PROC_FS , when 
PROC_FS is not set the user have no chance to set it on.

Thanks,

Ren

>
> A kernel build configuration without PROC_FS is quite special
> anyway... and then being interested in CHECKPOINT_ RESTORE for such a
> system is really really special. I wonder if that user then really
> knows what he or she is configuring at that point.
>
>
> Lukas
> .
.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH -next] init/Kconfig: fix unmet direct dependencies
  2022-09-28  7:20   ` Lukas Bulwahn
  2022-09-28  7:52     ` Ren Zhijie
@ 2022-09-28  9:14     ` Sebastian Andrzej Siewior
  2022-09-28  9:32       ` Arnd Bergmann
  1 sibling, 1 reply; 9+ messages in thread
From: Sebastian Andrzej Siewior @ 2022-09-28  9:14 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: Ren Zhijie, akpm, ndesaulniers, nathan, vbabka, masahiroy, arnd,
	seanjc, hannes, ojeda, mhiramat, dmitry.torokhov, atomlin, ddiss,
	christophe.leroy, linux-kernel

On 2022-09-28 09:20:42 [+0200], Lukas Bulwahn wrote:
> > Couldn't this become a depends?
> It could also be a depends (to resolve the warning).
> It is just the question whether:
> 
> When PROC_FS is not set, should the CHECKPOINT_RESTORE still be
> visible as a config option to add (and then automatically add
> PROC_FS)? Then select is right here.

then CHECKPOINT_RESTORE is the only option selecting PROC_FS while
everyone else depends on it _or_ avoids using it in the absence of
PROC_FS.

Sebastian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH -next] init/Kconfig: fix unmet direct dependencies
  2022-09-28  9:14     ` Sebastian Andrzej Siewior
@ 2022-09-28  9:32       ` Arnd Bergmann
  2022-09-28 11:43         ` Lukas Bulwahn
  2022-09-29  6:48         ` Ren Zhijie
  0 siblings, 2 replies; 9+ messages in thread
From: Arnd Bergmann @ 2022-09-28  9:32 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior, Lukas Bulwahn
  Cc: Ren Zhijie, Andrew Morton, Nick Desaulniers, Nathan Chancellor,
	Vlastimil Babka, Masahiro Yamada, seanjc, Johannes Weiner, ojeda,
	Masami Hiramatsu, Dmitry Torokhov, atomlin, ddiss,
	Christophe Leroy, linux-kernel

On Wed, Sep 28, 2022, at 11:14 AM, Sebastian Andrzej Siewior wrote:
> On 2022-09-28 09:20:42 [+0200], Lukas Bulwahn wrote:
>> > Couldn't this become a depends?
>> It could also be a depends (to resolve the warning).
> …
>> It is just the question whether:
>> 
>> When PROC_FS is not set, should the CHECKPOINT_RESTORE still be
>> visible as a config option to add (and then automatically add
>> PROC_FS)? Then select is right here.
>
> then CHECKPOINT_RESTORE is the only option selecting PROC_FS while
> everyone else depends on it _or_ avoids using it in the absence of
> PROC_FS.

Right, we should not mix 'select' and 'depends on' for the same
symbol, as that leads to circular dependencies and general
confusion.

If there is no way to use CHECKPOINT_RESTORE without procfs,
then the symbol should just not be visible (it will still show
up with the dependency when one searches in menuconfig).
Force-enabling a major subsystem like procfs from another
symbol is not a good solution.

    Arnd

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH -next] init/Kconfig: fix unmet direct dependencies
  2022-09-28  9:32       ` Arnd Bergmann
@ 2022-09-28 11:43         ` Lukas Bulwahn
  2022-09-29  6:48         ` Ren Zhijie
  1 sibling, 0 replies; 9+ messages in thread
From: Lukas Bulwahn @ 2022-09-28 11:43 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Sebastian Andrzej Siewior, Ren Zhijie, Andrew Morton,
	Nick Desaulniers, Nathan Chancellor, Vlastimil Babka,
	Masahiro Yamada, seanjc, Johannes Weiner, ojeda,
	Masami Hiramatsu, Dmitry Torokhov, atomlin, ddiss,
	Christophe Leroy, linux-kernel

On Wed, Sep 28, 2022 at 11:32 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Wed, Sep 28, 2022, at 11:14 AM, Sebastian Andrzej Siewior wrote:
> > On 2022-09-28 09:20:42 [+0200], Lukas Bulwahn wrote:
> >> > Couldn't this become a depends?
> >> It could also be a depends (to resolve the warning).
> > …
> >> It is just the question whether:
> >>
> >> When PROC_FS is not set, should the CHECKPOINT_RESTORE still be
> >> visible as a config option to add (and then automatically add
> >> PROC_FS)? Then select is right here.
> >
> > then CHECKPOINT_RESTORE is the only option selecting PROC_FS while
> > everyone else depends on it _or_ avoids using it in the absence of
> > PROC_FS.
>
> Right, we should not mix 'select' and 'depends on' for the same
> symbol, as that leads to circular dependencies and general
> confusion.
>
> If there is no way to use CHECKPOINT_RESTORE without procfs,
> then the symbol should just not be visible (it will still show
> up with the dependency when one searches in menuconfig).
> Force-enabling a major subsystem like procfs from another
> symbol is not a good solution.
>

Agree. I retract my Reviewed-by.

The arguments are clear to make this depend on PROC_FS.

Lukas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH -next] init/Kconfig: fix unmet direct dependencies
  2022-09-28  9:32       ` Arnd Bergmann
  2022-09-28 11:43         ` Lukas Bulwahn
@ 2022-09-29  6:48         ` Ren Zhijie
  1 sibling, 0 replies; 9+ messages in thread
From: Ren Zhijie @ 2022-09-29  6:48 UTC (permalink / raw)
  To: Arnd Bergmann, Sebastian Andrzej Siewior, Lukas Bulwahn
  Cc: Andrew Morton, Nick Desaulniers, Nathan Chancellor,
	Vlastimil Babka, Masahiro Yamada, seanjc, Johannes Weiner, ojeda,
	Masami Hiramatsu, Dmitry Torokhov, atomlin, ddiss,
	Christophe Leroy, linux-kernel


在 2022/9/28 17:32, Arnd Bergmann 写道:
> On Wed, Sep 28, 2022, at 11:14 AM, Sebastian Andrzej Siewior wrote:
>> On 2022-09-28 09:20:42 [+0200], Lukas Bulwahn wrote:
>>>> Couldn't this become a depends?
>>> It could also be a depends (to resolve the warning).
>> …
>>> It is just the question whether:
>>>
>>> When PROC_FS is not set, should the CHECKPOINT_RESTORE still be
>>> visible as a config option to add (and then automatically add
>>> PROC_FS)? Then select is right here.
>> then CHECKPOINT_RESTORE is the only option selecting PROC_FS while
>> everyone else depends on it _or_ avoids using it in the absence of
>> PROC_FS.
> Right, we should not mix 'select' and 'depends on' for the same
> symbol, as that leads to circular dependencies and general
> confusion.
>
> If there is no way to use CHECKPOINT_RESTORE without procfs,
> then the symbol should just not be visible (it will still show
> up with the dependency when one searches in menuconfig).
> Force-enabling a major subsystem like procfs from another
> symbol is not a good solution.

Agree that,  i will fix it in patch v2.

Thanks,

Ren

>      Arnd
> .

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-09-29  6:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28  6:49 [PATCH -next] init/Kconfig: fix unmet direct dependencies Ren Zhijie
2022-09-28  7:01 ` Sebastian Andrzej Siewior
2022-09-28  7:20   ` Lukas Bulwahn
2022-09-28  7:52     ` Ren Zhijie
2022-09-28  9:14     ` Sebastian Andrzej Siewior
2022-09-28  9:32       ` Arnd Bergmann
2022-09-28 11:43         ` Lukas Bulwahn
2022-09-29  6:48         ` Ren Zhijie
2022-09-28  7:12 ` Lukas Bulwahn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).