Skip to content

Commit 631b0cf

Browse files
Yuanhan Liutorvalds
authored andcommitted
mm: fix wrong comments about anon_vma lock
We use rwsem since commit 5a50508 ("mm/rmap: Convert the struct anon_vma::mutex to an rwsem"). And most of comments are converted to the new rwsem lock; while just 2 more missed from: $ git grep 'anon_vma->mutex' Signed-off-by: Yuanhan Liu <[email protected]> Acked-by: Ingo Molnar <[email protected]> Cc: Mel Gorman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 249d9d9 commit 631b0cf

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

include/linux/mmu_notifier.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ struct mmu_notifier_ops {
151151
* Therefore notifier chains can only be traversed when either
152152
*
153153
* 1. mmap_sem is held.
154-
* 2. One of the reverse map locks is held (i_mmap_mutex or anon_vma->mutex).
154+
* 2. One of the reverse map locks is held (i_mmap_mutex or anon_vma->rwsem).
155155
* 3. No other concurrent thread can access the list (release)
156156
*/
157157
struct mmu_notifier {

mm/mmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2943,7 +2943,7 @@ static void vm_lock_mapping(struct mm_struct *mm, struct address_space *mapping)
29432943
* vma in this mm is backed by the same anon_vma or address_space.
29442944
*
29452945
* We can take all the locks in random order because the VM code
2946-
* taking i_mmap_mutex or anon_vma->mutex outside the mmap_sem never
2946+
* taking i_mmap_mutex or anon_vma->rwsem outside the mmap_sem never
29472947
* takes more than one of them in a row. Secondly we're protected
29482948
* against a concurrent mm_take_all_locks() by the mm_all_locks_mutex.
29492949
*

0 commit comments

Comments
 (0)