lkml.org 
[lkml]   [2022]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 12/35] mm: separate mmap locked assertion from find_vma
On Mon, Jan 31, 2022 at 02:44:55PM +0000, Matthew Wilcox wrote:
> On Fri, Jan 28, 2022 at 05:09:43AM -0800, Michel Lespinasse wrote:
> > This adds a new __find_vma() function, which implements find_vma minus
> > the mmap_assert_locked() assertion.
> >
> > find_vma() is then implemented as an inline wrapper around __find_vma().
>
> You might like to take inspiration from the maple tree patches
> where we assert that either the RCU lock is held or the mmap_lock
> is held.

I've been considering it, but I'm not sure we want to go that way:
it's not sufficient for the caller to have an RCU read lock,
they also need to do the proper mmap_seq_read_check() after
dereferencing the vma... So I think having this different set of
expectations for the two cases warrants using a different name
to keep things more explicit.

--
Michel "walken" Lespinasse

\
 
 \ /
  Last update: 2022-02-04 23:41    [W:0.282 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site