Re: [PATCH 1/4] mm: declare VMA flags by bit

From: Jason Gunthorpe

Date: Thu Oct 30 2025 - 08:55:25 EST


On Thu, Oct 30, 2025 at 09:07:19AM +0000, Lorenzo Stoakes wrote:
> > > fs/proc/task_mmu.c | 4 +-
> > > include/linux/mm.h | 286 +++++++++++++++++---------
> > > tools/testing/vma/vma_internal.h | 341 +++++++++++++++++++++++++++----
> >
> > Maybe take the moment to put them in some vma_flags.h and then can
> > that be included from tools/testing to avoid this copying??
>
> It sucks to have this copy/paste yeah. The problem is to make the VMA
> userland testing work, we intentionally isolate vma.h/vma.c dependencies
> into vma_internal.h in mm/ and also do the same in the userland component,
> so we can #include vma.c/h in the userland code.
>
> So we'd have to have a strict requirement that vma_flags.h doesn't import
> any other headers or at least none which aren't substituted somehow in the
> tools/include directory.

I think that's fine, much better than copying it like this..

> The issue is people might quite reasonably update include/linux/vma_flags.h
> to do more later and then break all of the VMA userland testing...

If only the selftest build system wasn't such a PITA maybe more people
would run it :(

Jason