# 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 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/08/17361994
- Thread: https://ratatoskr.run/netdev/2026/08/17355349/t.md

```text
On 8/3/26 21:13, Suren Baghdasaryan wrote:
> On Mon, Aug 3, 2026 at 9:44 AM Lorenzo Stoakes (ARM) [ref] wrote:
>> 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!


```
