lkml.org 
[lkml]   [2021]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/2] mm: protect free_pgtables with mmap_lock write lock in exit_mmap
On Tue, Dec 07, 2021 at 03:08:19PM -0800, Suren Baghdasaryan wrote:
> > > /**
> > > * @close: Called when the VMA is being removed from the MM.
> > > * Context: Caller holds mmap_lock.
>
> BTW, is the caller always required to hold mmap_lock for write or it
> *might* hold it?

__do_munmap() might hold it for read, thanks to:

if (downgrade)
mmap_write_downgrade(mm);

Should probably say:

* Context: User context. May sleep. Caller holds mmap_lock.

I don't think we should burden the implementor of the vm_ops with the
knowledge that the VM chooses to not hold the mmap_lock under certain
circumstances when it doesn't matter whether it's holding the mmap_lock
or not.

\
 
 \ /
  Last update: 2021-12-08 16:02    [W:0.062 / U:1.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site