[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <o3c66lbg2c43wtut6hyoruggdp65jdb22gtyn6scnycluevqs3@f2rzgmqlri2w>
Date: Tue, 2 Jul 2024 13:38:58 -0400
From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
To: Lorenzo Stoakes <lstoakes@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Vlastimil Babka <vbabka@...e.cz>, Matthew Wilcox <willy@...radead.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
Eric Biederman <ebiederm@...ssion.com>, Kees Cook <kees@...nel.org>,
Suren Baghdasaryan <surenb@...gle.com>
Subject: Re: [RFC PATCH v2 4/7] mm: move internal core VMA manipulation
functions to own file
* Lorenzo Stoakes <lstoakes@...il.com> [240628 10:35]:
> This patch introduces vma.c and moves internal core VMA manipulation
> functions to this file from mmap.c.
>
> This allows us to isolate VMA functionality in a single place such that we
> can create userspace testing code that invokes this functionality in an
> environment where we can implement simple unit tests of core functionality.
>
> This patch ensures that core VMA functionality is explicitly marked as such
> by its presence in mm/vma.h.
>
> It also places the header includes required by vma.c in vma_internal.h,
> which is simply imported by vma.c. This makes the VMA functionality
> testable, as userland testing code can simply stub out functionality
> as required.
>
> Signed-off-by: Lorenzo Stoakes <lstoakes@...il.com>
> ---
> include/linux/mm.h | 35 -
> mm/Makefile | 2 +-
> mm/internal.h | 236 +-----
> mm/mmap.c | 1981 +++-----------------------------------------
> mm/mmu_notifier.c | 2 +
> mm/vma.c | 1766 +++++++++++++++++++++++++++++++++++++++
> mm/vma.h | 362 ++++++++
> mm/vma_internal.h | 52 ++
> 8 files changed, 2293 insertions(+), 2143 deletions(-)
> create mode 100644 mm/vma.c
> create mode 100644 mm/vma.h
> create mode 100644 mm/vma_internal.h
>
...
> diff --git a/mm/mmap.c b/mm/mmap.c
> index d2eebbed87b9..721870f380bf 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -57,6 +57,7 @@
> #include <trace/events/mmap.h>
>
> #include "internal.h"
> +#include "vma.h"
This isn't needed as internal.h includes vma.h in this revision.
>
> #ifndef arch_mmap_check
> #define arch_mmap_check(addr, len, flags) (0)
...
Thanks,
Liam
Powered by blists - more mailing lists