linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/uffd: Move USERFAULTFD configs into mm/
@ 2022-04-20 14:48 Peter Xu
  2022-04-20 15:31 ` Johannes Weiner
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Xu @ 2022-04-20 14:48 UTC (permalink / raw)
  To: linux-kernel, linux-mm
  Cc: Andrew Morton, Andrea Arcangeli, peterx, Alistair Popple,
	Johannes Weiner, Axel Rasmussen, Mike Rapoport, Mike Kravetz,
	Nadav Amit

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.

Suggested-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Peter Xu <peterx@redhat.com>
---

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

diff --git a/init/Kconfig b/init/Kconfig
index 6a32b466dad1..0a358fc858cd 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -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
 
diff --git a/mm/Kconfig b/mm/Kconfig
index d740e1ff3b2f..f268ba545e02 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -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
 
-- 
2.32.0


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

* Re: [PATCH] mm/uffd: Move USERFAULTFD configs into mm/
  2022-04-20 14:48 [PATCH] mm/uffd: Move USERFAULTFD configs into mm/ Peter Xu
@ 2022-04-20 15:31 ` Johannes Weiner
  2022-04-20 16:46   ` Axel Rasmussen
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Weiner @ 2022-04-20 15:31 UTC (permalink / raw)
  To: Peter Xu
  Cc: linux-kernel, linux-mm, Andrew Morton, Andrea Arcangeli,
	Alistair Popple, Axel Rasmussen, Mike Rapoport, Mike Kravetz,
	Nadav Amit

On Wed, Apr 20, 2022 at 10:48:23AM -0400, Peter Xu wrote:
> 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.
> 
> Suggested-by: Johannes Weiner <hannes@cmpxchg.org>
> Signed-off-by: Peter Xu <peterx@redhat.com>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

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

* Re: [PATCH] mm/uffd: Move USERFAULTFD configs into mm/
  2022-04-20 15:31 ` Johannes Weiner
@ 2022-04-20 16:46   ` Axel Rasmussen
  0 siblings, 0 replies; 3+ messages in thread
From: Axel Rasmussen @ 2022-04-20 16:46 UTC (permalink / raw)
  To: Johannes Weiner
  Cc: Peter Xu, LKML, Linux MM, Andrew Morton, Andrea Arcangeli,
	Alistair Popple, Mike Rapoport, Mike Kravetz, Nadav Amit

Reviewed-by: Axel Rasmussen <axelrasmussen@google.com>

On Wed, Apr 20, 2022 at 8:31 AM Johannes Weiner <hannes@cmpxchg.org> wrote:
>
> On Wed, Apr 20, 2022 at 10:48:23AM -0400, Peter Xu wrote:
> > 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.
> >
> > Suggested-by: Johannes Weiner <hannes@cmpxchg.org>
> > Signed-off-by: Peter Xu <peterx@redhat.com>
>
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>

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

end of thread, other threads:[~2022-04-20 16:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 14:48 [PATCH] mm/uffd: Move USERFAULTFD configs into mm/ Peter Xu
2022-04-20 15:31 ` Johannes Weiner
2022-04-20 16:46   ` Axel Rasmussen

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