Re: [PATCH v2 1/5] mm: Make per-VMA locks available universally

From: Vlastimil Babka (SUSE)

Date: Fri Jun 12 2026 - 10:10:08 EST


On 6/11/26 21:29, Suren Baghdasaryan wrote:
>> -
>> -/*
>> - * At least xtensa ends up having protection faults even with no
>> - * MMU.. No stack expansion, at least.
>> - */
>> -struct vm_area_struct *lock_mm_and_find_vma(struct mm_struct *mm,
>> - unsigned long addr, struct pt_regs *regs)
>> -{
>> - struct vm_area_struct *vma;
>> -
>> - mmap_read_lock(mm);
>> - vma = vma_lookup(mm, addr);
>> - if (!vma)
>> - mmap_read_unlock(mm);
>> - return vma;
>> -}
>
> Might this removal break CONFIG_MMU=n && CONFIG_LOCK_MM_AND_FIND_VMA=n case?

Seems to me only the architectures that select CONFIG_LOCK_MM_AND_FIND_VMA
also call lock_mm_and_find_vma(). So it's probably fine?

I think this fallback was only for architectures that select
CONFIG_LOCK_MM_AND_FIND_VMA *and* have CONFIG_MMU=n (variant).
It just wasn't guarded by #ifdef CONFIG_LOCK_MM_AND_FIND_VMA as well.

>> -
>> -#endif /* CONFIG_MMU */
>> diff -puN mm/pagewalk.c~unconditional-vma-locks mm/pagewalk.c