Re: [PATCH 4/5] mm: add and use mmap_read_lock[_killable]_nosteal() on contention

From: Alexei Starovoitov

Date: Thu Nov 05 2026 - 11:46:34 EST


On Thu, Nov 05, 2026 at 02:16 AM David Hildenbrand (Arm) <david@xxxxxxxxxx> wrote:
> On 11/3/26 09:27, Lorenzo Stoakes (ARM) wrote:
>> With down_read[_killable]_nosteal() available, it becomes possible to
>> release the mmap read lock in such a way that a queued write lock always
>> takes precedence.
>>
>> Expose this to mm through two new wrappers - mmap_read_lock_nosteal() and
>> mmap_read_lock_killable_nosteal().
>>
>> Make use of this in scenarios where the mmap read lock is dropped
>> explicitly for the purposes of relieving mmap_lock contention - the BPF
>> task VMA iterator, and lock_next_vma_under_mmap_lock(), which is where
>> /proc/$pid/smaps_rollup re-acquires the mmap lock after dropping it on
>> contention and falling back from per-VMA locking.
>>
>> Signed-off-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
>> ---
>> include/linux/mmap_lock.h | 44 ++++++++++++++++++++++++++++++++++++++++++++
>> kernel/bpf/task_iter.c | 2 +-
>
>
> I'd appreciate an ack from BPF folks and a confirmation that I could take this
> through my tree :)

Sure. Pls take it through your tree.
No conflicts with bpf and bpf-next.

Acked-by: Alexei Starovoitov <ast@xxxxxxxxxx>