Skip to contentSkip to conversation

mm/uffd: Move USERFAULTFD configs into mm/

PATCH Applied Peter Xu 3 participants 3 messages Apr 20, 2022

Subsystems (2)
lore
Share & tools
lore

Peter Xu

author
#0 lore raw

PATCH 1/1 mm/uffd: Move USERFAULTFD configs into mm/

We used to have USERFAULTFD configs stored in init/. It makes sense as a start because that's the default place for storing syscall related configs.

However userfaultfd evolved a bit in the past few years and some more config options were added. They're no longer related to syscalls and start to be not suitable to be kept in the init/ directory anymore, because they're pure mm concepts.

But it's not ideal either to keep the userfaultfd configs separate from each other. Hence this patch moves the userfaultfd configs under init/ to be under mm/ so that we'll start to group all userfaultfd configs together.

We do have quite a few examples of syscall related configs that are not put under init/Kconfig: FTRACE_SYSCALLS, SWAP, FILE_LOCKING, MEMFD_CREATE.. They all reside in the dir where they're more suitable for the concept. So it seems there's no restriction to keep the role of having syscall related CONFIG_* under init/ only.

---

NOTE: there's a light dependency to patch "mm/uffd: Hide PTE_MARKER option".

---
 init/Kconfig | 17 -----------------
 mm/Kconfig   | 17 +++++++++++++++++
 2 files changed, 17 insertions(+), 17 deletions(-)
init/Kconfig +0 -17
index 6a32b466dad1..0a358fc858cd 100644
@@ -1685,16 +1685,6 @@ config ADVISE_SYSCALLS
 	  applications use these syscalls, you can disable this option to save
 	  space.
 
-config HAVE_ARCH_USERFAULTFD_WP
-	bool
-	help
-	  Arch has userfaultfd write protection support
-
-config HAVE_ARCH_USERFAULTFD_MINOR
-	bool
-	help
-	  Arch has userfaultfd minor fault support
-
 config MEMBARRIER
 	bool "Enable membarrier() system call" if EXPERT
 	default y
@@ -1759,13 +1749,6 @@ config KALLSYMS_BASE_RELATIVE
 
 # syscall, maps, verifier
 
-config USERFAULTFD
-	bool "Enable userfaultfd() system call"
-	depends on MMU
-	help
-	  Enable the userfaultfd() system call that allows to intercept and
-	  handle page faults in userland.
-
 config ARCH_HAS_MEMBARRIER_CALLBACKS
 	bool
 
mm/Kconfig +17 -0
index d740e1ff3b2f..f268ba545e02 100644
@@ -909,6 +909,23 @@ config ANON_VMA_NAME
 	  area from being merged with adjacent virtual memory areas due to the
 	  difference in their name.
 
+config USERFAULTFD
+	bool "Enable userfaultfd() system call"
+	depends on MMU
+	help
+	  Enable the userfaultfd() system call that allows to intercept and
+	  handle page faults in userland.
+
+config HAVE_ARCH_USERFAULTFD_WP
+	bool
+	help
+	  Arch has userfaultfd write protection support
+
+config HAVE_ARCH_USERFAULTFD_MINOR
+	bool
+	help
+	  Arch has userfaultfd minor fault support
+
 config PTE_MARKER
 	bool
 
Signature · 1 line
2.32.0
Acked-by on v1 1/1
#1 lore raw
Quoted 13 lines · Peter Xu

We used to have USERFAULTFD configs stored in init/. It makes sense as a start because that's the default place for storing syscall related configs.

However userfaultfd evolved a bit in the past few years and some more config options were added. They're no longer related to syscalls and start to be not suitable to be kept in the init/ directory anymore, because they're pure mm concepts.

But it's not ideal either to keep the userfaultfd configs separate from each other. Hence this patch moves the userfaultfd configs under init/ to be under mm/ so that we'll start to group all userfaultfd configs together.

Quoted 8 lines

We do have quite a few examples of syscall related configs that are not put under init/Kconfig: FTRACE_SYSCALLS, SWAP, FILE_LOCKING, MEMFD_CREATE.. They all reside in the dir where they're more suitable for the concept. So it seems there's no restriction to keep the role of having syscall related CONFIG_* under init/ only.

Reviewed-by
#2 lore raw
Quoted 25 lines · Johannes Weiner
Quoted 13 lines · Peter Xu

We used to have USERFAULTFD configs stored in init/. It makes sense as a start because that's the default place for storing syscall related configs.

However userfaultfd evolved a bit in the past few years and some more config options were added. They're no longer related to syscalls and start to be not suitable to be kept in the init/ directory anymore, because they're pure mm concepts.

But it's not ideal either to keep the userfaultfd configs separate from each other. Hence this patch moves the userfaultfd configs under init/ to be under mm/ so that we'll start to group all userfaultfd configs together.

Quoted 8 lines

We do have quite a few examples of syscall related configs that are not put under init/Kconfig: FTRACE_SYSCALLS, SWAP, FILE_LOCKING, MEMFD_CREATE.. They all reside in the dir where they're more suitable for the concept. So it seems there's no restriction to keep the role of having syscall related CONFIG_* under init/ only.