Re: [PATCH v2 30/33] mm/vma: correct incorrect vma.h inclusion

"Lorenzo Stoakes (ARM)" <[email protected]>
Newsgroups dev.linux.lists.damon,dev.linux.lists.iommu,dev.linux.lists.nvdimm,org.freedesktop.lists.dri-devel,org.kernel.vger.kvm,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-parisc,org.kernel.vger.linux-perf-users,org.kernel.vger.linux-sgx,org.kernel.vger.linux-tegra,org.kernel.vger.linux-trace-kernel
Message-ID <alimfeUEoGdnEd9W@lucifer>
On Thu, Jul 16, 2026 at 10:38:00AM +0200, Vlastimil Babka (SUSE) wrote:
> On 7/10/26 22:17, Lorenzo Stoakes wrote:
> > The only files which should be including vma.h are the implementation files
> > for the core VMA logic - vma.c, vma_init.c, and vma_exec.c.
> >
> > This is in order to allow for userland testing of core VMA logic. In this
> > cases, vma_internal.h and vma.h are included, providing both the
> > dependencies upon which the core VMA logic requires and its declarations.
> >
> > Userland testable VMA logic is achieved by having separate vma_internal.h
> > implementations for userland and kernel.
> >
> > Callers other than the core VMA implementation should include internal.h
> > instead. This header does not need to include vma_internal.h as it only
> > contains the vma.h declarations, for which the includes already present
> > suffice.
> >
> > Update code to reflect this, update comments to reflect the fact there are
> > 3 VMA implementation files and document things more clearly.
> >
> > While we're here, slightly improve the language of the comment describing
> > vma_exec.c.
> >
> > No functional change intended.
> >
> > Reviewed-by: Pedro Falcato <[email protected]>
> > Reviewed-by: Gregory Price <[email protected]>
> > Signed-off-by: Lorenzo Stoakes <[email protected]>
>
> Reviewed-by: Vlastimil Babka (SUSE) <[email protected]>

Thanks!

>
> But given Mike's efforts [1] I wonder if there's a way to change the vma
> header system in the future to stop requiring users of vma functions to
> include the whole internal.h, while of course still allow the userland
> testability.
>
> [1]
> https://lore.kernel.org/all/[email protected]/

Yeah we can always put a (correctly formed) vma.h include in any split off headers.

There's also Pedro's suggestion (my reply to that at [0]) which I plan to do as
a follow up :)

[0]:https://lore.kernel.org/all/akzWq08xwXKqwwtq@lucifer/

>
>

Cheers, Lorenzo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.