Messages in this thread | | | Date | Fri, 4 Feb 2022 14:41:33 -0800 | From | Michel Lespinasse <> | Subject | Re: [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
| |