[PATCH] mm: more commenting on lock ordering
Clarify lockorder comments now that sys_msync dropps mmap_sem before calling do_fsync. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
b95936cb92
commit
82591e6ea2
2 changed files with 17 additions and 23 deletions
|
@ -75,8 +75,8 @@ generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
|
|||
* ->mmap_sem
|
||||
* ->lock_page (access_process_vm)
|
||||
*
|
||||
* ->mmap_sem
|
||||
* ->i_mutex (msync)
|
||||
* ->i_mutex (generic_file_buffered_write)
|
||||
* ->mmap_sem (fault_in_pages_readable->do_page_fault)
|
||||
*
|
||||
* ->i_mutex
|
||||
* ->i_alloc_sem (various)
|
||||
|
|
|
@ -21,13 +21,7 @@
|
|||
* Lock ordering in mm:
|
||||
*
|
||||
* inode->i_mutex (while writing or truncating, not reading or faulting)
|
||||
* inode->i_alloc_sem
|
||||
*
|
||||
* When a page fault occurs in writing from user to file, down_read
|
||||
* of mmap_sem nests within i_mutex; in sys_msync, i_mutex nests within
|
||||
* down_read of mmap_sem; i_mutex and down_write of mmap_sem are never
|
||||
* taken together; in truncation, i_mutex is taken outermost.
|
||||
*
|
||||
* inode->i_alloc_sem (vmtruncate_range)
|
||||
* mm->mmap_sem
|
||||
* page->flags PG_locked (lock_page)
|
||||
* mapping->i_mmap_lock
|
||||
|
|
Loading…
Reference in a new issue