mmap locking API: convert mmap_sem comments
Convert comments that reference mmap_sem to reference mmap_lock instead. [akpm@linux-foundation.org: fix up linux-next leftovers] [akpm@linux-foundation.org: s/lockaphore/lock/, per Vlastimil] [akpm@linux-foundation.org: more linux-next fixups, per Michel] Signed-off-by: Michel Lespinasse <walken@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Vlastimil Babka <vbabka@suse.cz> Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com> Cc: Davidlohr Bueso <dbueso@suse.de> Cc: David Rientjes <rientjes@google.com> Cc: Hugh Dickins <hughd@google.com> Cc: Jason Gunthorpe <jgg@ziepe.ca> Cc: Jerome Glisse <jglisse@redhat.com> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Laurent Dufour <ldufour@linux.ibm.com> Cc: Liam Howlett <Liam.Howlett@oracle.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ying Han <yinghan@google.com> Link: http://lkml.kernel.org/r/20200520052908.204642-13-walken@google.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Šī revīzija ir iekļauta:

revīziju iesūtīja
Linus Torvalds

vecāks
3e4e28c5a8
revīzija
c1e8d7c6a7
@@ -1173,7 +1173,7 @@ xfs_file_llseek(
|
||||
* Locking for serialisation of IO during page faults. This results in a lock
|
||||
* ordering of:
|
||||
*
|
||||
* mmap_sem (MM)
|
||||
* mmap_lock (MM)
|
||||
* sb_start_pagefault(vfs, freeze)
|
||||
* i_mmaplock (XFS - truncate serialisation)
|
||||
* page_lock (MM)
|
||||
|
@@ -145,17 +145,17 @@ xfs_ilock_attr_map_shared(
|
||||
*
|
||||
* i_rwsem -> i_mmap_lock -> page_lock -> i_ilock
|
||||
*
|
||||
* mmap_sem locking order:
|
||||
* mmap_lock locking order:
|
||||
*
|
||||
* i_rwsem -> page lock -> mmap_sem
|
||||
* mmap_sem -> i_mmap_lock -> page_lock
|
||||
* i_rwsem -> page lock -> mmap_lock
|
||||
* mmap_lock -> i_mmap_lock -> page_lock
|
||||
*
|
||||
* The difference in mmap_sem locking order mean that we cannot hold the
|
||||
* The difference in mmap_lock locking order mean that we cannot hold the
|
||||
* i_mmap_lock over syscall based read(2)/write(2) based IO. These IO paths can
|
||||
* fault in pages during copy in/out (for buffered IO) or require the mmap_sem
|
||||
* fault in pages during copy in/out (for buffered IO) or require the mmap_lock
|
||||
* in get_user_pages() to map the user pages into the kernel address space for
|
||||
* direct IO. Similarly the i_rwsem cannot be taken inside a page fault because
|
||||
* page faults already hold the mmap_sem.
|
||||
* page faults already hold the mmap_lock.
|
||||
*
|
||||
* Hence to serialise fully against both syscall and mmap based IO, we need to
|
||||
* take both the i_rwsem and the i_mmap_lock. These locks should *only* be both
|
||||
@@ -1630,7 +1630,7 @@ xfs_release(
|
||||
return 0;
|
||||
/*
|
||||
* If we can't get the iolock just skip truncating the blocks
|
||||
* past EOF because we could deadlock with the mmap_sem
|
||||
* past EOF because we could deadlock with the mmap_lock
|
||||
* otherwise. We'll get another chance to drop them once the
|
||||
* last reference to the inode is dropped, so we'll never leak
|
||||
* blocks permanently.
|
||||
|
@@ -28,11 +28,11 @@
|
||||
#include <linux/fiemap.h>
|
||||
|
||||
/*
|
||||
* Directories have different lock order w.r.t. mmap_sem compared to regular
|
||||
* Directories have different lock order w.r.t. mmap_lock compared to regular
|
||||
* files. This is due to readdir potentially triggering page faults on a user
|
||||
* buffer inside filldir(), and this happens with the ilock on the directory
|
||||
* held. For regular files, the lock order is the other way around - the
|
||||
* mmap_sem is taken during the page fault, and then we lock the ilock to do
|
||||
* mmap_lock is taken during the page fault, and then we lock the ilock to do
|
||||
* block mapping. Hence we need a different class for the directory ilock so
|
||||
* that lockdep can tell them apart.
|
||||
*/
|
||||
|
Atsaukties uz šo jaunā problēmā
Block a user