Re: [PATCH v3 3/5] mm: Add RCU-based VMA lookup helper that waits for writers
"Lorenzo Stoakes (ARM)" <[email protected]> Tue, 4 Aug 2026 09:44:11 +0100
| Newsgroups | gmane.linux.network,gmane.linux.kernel,gmane.linux.kernel.mm |
|---|---|
| Message-ID | <anGmUrVVabSqWZq7@lucifer> |
On Tue, Aug 04, 2026 at 09:59:26AM +0200, Vlastimil Babka (SUSE) wrote: > On 8/3/26 21:13, Suren Baghdasaryan wrote: > > On Mon, Aug 3, 2026 at 9:44 AM Lorenzo Stoakes (ARM) <[email protected]> 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! Agreed thanks! > >