Commit 82591e6e authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

[PATCH] mm: more commenting on lock ordering

Clarify lockorder comments now that sys_msync dropps mmap_sem before
calling do_fsync.
Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b95936cb
...@@ -75,8 +75,8 @@ generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, ...@@ -75,8 +75,8 @@ generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
* ->mmap_sem * ->mmap_sem
* ->lock_page (access_process_vm) * ->lock_page (access_process_vm)
* *
* ->mmap_sem * ->i_mutex (generic_file_buffered_write)
* ->i_mutex (msync) * ->mmap_sem (fault_in_pages_readable->do_page_fault)
* *
* ->i_mutex * ->i_mutex
* ->i_alloc_sem (various) * ->i_alloc_sem (various)
......
...@@ -21,13 +21,7 @@ ...@@ -21,13 +21,7 @@
* Lock ordering in mm: * Lock ordering in mm:
* *
* inode->i_mutex (while writing or truncating, not reading or faulting) * inode->i_mutex (while writing or truncating, not reading or faulting)
* inode->i_alloc_sem * inode->i_alloc_sem (vmtruncate_range)
*
* 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.
*
* mm->mmap_sem * mm->mmap_sem
* page->flags PG_locked (lock_page) * page->flags PG_locked (lock_page)
* mapping->i_mmap_lock * mapping->i_mmap_lock
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment