Re: [PATCH v3 3/5] mm: Add RCU-based VMA lookup helper that waits for writers

From
Vlastimil Babka (SUSE) <vbabka@kernel.org>
Date
2026-08-04 07:59:32
Also in
lkml
Reply to
Suren Baghdasaryan, 2026-08-03
On 8/3/26 21:13, Suren Baghdasaryan wrote:
On Mon, Aug 3, 2026 at 9:44 AM Lorenzo Stoakes (ARM) [off-list ref] wrote:
quoted
Agree this is worth spelling out in the comment (I raised similarly).

Maybe something like:

        If a VMA exists which spans @address, return that VMA, read-locked.

        If no VMA is mapped there or, very unlikely, a reference count overflow
        occurred, return NULL.

        Nothing prevents VMAs being unmapped/mapped before or after the VMA is
        looked up, if a stronger guarantee is required, take an mmap lock.
This last statement is true only if the function returns NULL, so I
think it should be in the same paragraph as the "If no VMA is
mapped..." sentence and prepended with "In this case...". So:

       If no VMA is mapped there or, very unlikely, a reference count overflow
       occurred, return NULL. In this case, nothing prevents VMAs
being unmapped/
       mapped before or after the VMA is looked up, if a stronger guarantee is
       required, take an mmap lock.

Does that sounds good?
Yeah, thanks both!

Thread (48 messages) 48 messages, 6 authors, last reply 2026-08-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help