Skip to contentSkip to conversation

init/Kconfig: fix unmet direct dependencies

PATCH Superseded Ren Zhijie 4 participants 9 messages Sep 28, 2022 – Sep 29, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Ren Zhijie

author
#0 lore raw

PATCH 1/1 init/Kconfig: fix unmet direct dependencies

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")
---
 init/Kconfig | 1 +
 1 file changed, 1 insertion(+)
init/Kconfig +1 -0
index e11307310fc1..fc32b28fe93e 100644
@@ -1273,6 +1273,7 @@ endif # NAMESPACES
 
 config CHECKPOINT_RESTORE
 	bool "Checkpoint/restore support"
+	select PROC_FS
 	select PROC_CHILDREN
 	select KCMP
 	default n
Signature · 1 line
2.17.1
#1 lore raw

init/Kconfig endif # NAMESPACES · line 1276

Quoted 7 lines · Ren Zhijie
init/Kconfig +1 -0
@@ -1273,6 +1273,7 @@ endif # NAMESPACES
 
 config CHECKPOINT_RESTORE
 	bool "Checkpoint/restore support"
+	select PROC_FS

Couldn't this become a depends?

init/Kconfig endif # NAMESPACES · line 1279

Quoted 3 lines
init/Kconfig +0 -0
 	select PROC_CHILDREN
 	select KCMP
 	default n

Sebastian

#2 lore raw
Quoted 6 lines · Sebastian Andrzej Siewior
Quoted 4 lines · Ren Zhijie
init/Kconfig +0 -0
@@ -1273,6 +1273,7 @@ endif # NAMESPACES
 
Quoted 6 lines

init/Kconfig endif # NAMESPACES · line 1276

Quoted 3 lines
init/Kconfig +1 -0
 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

author
#3 lore raw
Quoted 27 lines · Lukas Bulwahn
Quoted 10 lines · Sebastian Andrzej Siewior

init/Kconfig endif # NAMESPACES · line 1276

Quoted 7 lines · Ren Zhijie
init/Kconfig +1 -0
@@ -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.

Quoted 4 lines

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

Quoted 9 lines

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
.

.

#4 lore raw
In reply to Lukas Bulwahn
Quoted 2 lines · Lukas Bulwahn
Quoted 1 line

Couldn't this become a depends?

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

…

Quoted 5 lines

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

#5 lore raw
Quoted 6 lines · Sebastian Andrzej Siewior
Quoted 2 lines · Lukas Bulwahn
Quoted 1 line

Couldn't this become a depends?

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

…

Quoted 2 lines

It is just the question whether:

Quoted 7 lines
Quoted 3 lines

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

#6 lore raw
Quoted 20 lines · Arnd Bergmann
Quoted 6 lines · Sebastian Andrzej Siewior
Quoted 2 lines · Lukas Bulwahn
Quoted 1 line

Couldn't this become a depends?

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

…

Quoted 2 lines

It is just the question whether:

Quoted 7 lines
Quoted 3 lines

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.

Quoted 6 lines

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

author
#7 lore raw
In reply to Arnd Bergmann
Quoted 17 lines · Arnd Bergmann
Quoted 4 lines · Sebastian Andrzej Siewior
Quoted 2 lines · Lukas Bulwahn
Quoted 1 line

Couldn't this become a depends?

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

…

Quoted 8 lines
Quoted 5 lines

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.

Quoted 5 lines

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

Quoted 2 lines

Arnd
.

Reviewed-by on v1 1/1
#8 lore raw
In reply to Ren Zhijie
Quoted 7 lines · 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:

Quoted 8 lines

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")

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.

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

Quoted 19 lines
---
 init/Kconfig | 1 +
 1 file changed, 1 insertion(+)
init/Kconfig +1 -1
index e11307310fc1..fc32b28fe93e 100644
@@ -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