[PATCH] mm: Kconfig: group swap, slab, hotplug and thp options into submenus fix

From: Johannes Weiner
Date: Wed May 11 2022 - 12:12:37 EST


WARNING: unmet direct dependencies detected for ARCH_WANT_GENERAL_HUGETLB
Depends on [n]: TRANSPARENT_HUGEPAGE [=n]
Selected by [y]:
- X86 [=y]

WARNING: unmet direct dependencies detected for ARCH_WANTS_THP_SWAP
Depends on [n]: TRANSPARENT_HUGEPAGE [=n]
Selected by [y]:
- X86 [=y] && X86_64 [=y]

The ARCH_WANT* symbols are selected by the arch to communicate
requests to THP if enabled. Those mustn't be inside the 'if THP' block
for user-visible THP options of course. Move them back out.

Reported-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx>
---
mm/Kconfig | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/mm/Kconfig b/mm/Kconfig
index 2c5935a28edf..c2f4a547ab00 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -692,6 +692,12 @@ config NOMMU_INITIAL_TRIM_EXCESS

See Documentation/admin-guide/mm/nommu-mmap.rst for more information.

+config ARCH_WANT_GENERAL_HUGETLB
+ bool
+
+config ARCH_WANTS_THP_SWAP
+ def_bool n
+
menuconfig TRANSPARENT_HUGEPAGE
bool "Transparent Hugepage Support"
depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE && !PREEMPT_RT
@@ -733,12 +739,6 @@ choice
benefit.
endchoice

-config ARCH_WANT_GENERAL_HUGETLB
- bool
-
-config ARCH_WANTS_THP_SWAP
- def_bool n
-
config THP_SWAP
def_bool y
depends on TRANSPARENT_HUGEPAGE && ARCH_WANTS_THP_SWAP && SWAP
--
2.35.3