Re: [RFC PATCH v1 1/2] x86/mm: use VMA lock for kernel faults on user addresses

From: Barry Song

Date: Sat Oct 24 2026 - 07:01:21 EST


On Tue, Aug 4, 2026 at 10:46 PM Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx> wrote:
[...]
> > >
> > > And finally - Willy is working on a grand clean up of this stuff _I think_ so
> > > you probably should coordinate with him also?
> >
> > I have no problem waiting for Matthew's work. It is the right
> > thing to refactor the duplicated code across architectures for
> > the VMA lock page fault path.
>
> Seems sensible thanks!
>

I'm not quite sure when Matthew's cleanup series will be sent.
Matthew, what's your plan for this?

Maybe we should send RFC v2 of this series on using per-VMA
locks for kernel faults on user-space addresses to collect
feedback across different architectures? RFC v1 only included
demos for two architectures.

We may need feedback from architecture maintainers to confirm
that we're correctly checking for page faults triggered by
kernel-space accesses to user-space addresses.

I also think the cleanup series might need to take this
requirement into account. So, even if the cleanup series hasn't
been sent yet, it might make sense to discuss these changes in
parallel?

Another suggestion I made earlier [1] was to wait for the writer
to finish and then retry acquiring the VMA lock, rather than
falling back to mmap_lock when lock_vma_under_rcu() fails on
the first attempt. I guess this is also something to take into
account when working on the cleanup series?

[1] https://lore.kernel.org/linux-mm/CAGsJ_4wXGf90BMoJp3_z8G4fMTAgED88RXvbp6C4Gf+iy_2nvg@xxxxxxxxxxxxxx/

Best Regards
Barry