Skip to content

Commit c8475d1

Browse files
Davidlohr Buesotorvalds
Davidlohr Bueso
authored andcommitted
mm/memory.c: share the i_mmap_rwsem
The unmap_mapping_range family of functions do the unmapping of user pages (ultimately via zap_page_range_single) without touching the actual interval tree, thus share the lock. Signed-off-by: Davidlohr Bueso <[email protected]> Cc: "Kirill A. Shutemov" <[email protected]> Acked-by: Hugh Dickins <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Peter Zijlstra (Intel) <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Srikar Dronamraju <[email protected]> Acked-by: Mel Gorman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 1acf2e0 commit c8475d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/memory.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2377,12 +2377,12 @@ void unmap_mapping_range(struct address_space *mapping,
23772377
details.last_index = ULONG_MAX;
23782378

23792379

2380-
i_mmap_lock_write(mapping);
2380+
i_mmap_lock_read(mapping);
23812381
if (unlikely(!RB_EMPTY_ROOT(&mapping->i_mmap)))
23822382
unmap_mapping_range_tree(&mapping->i_mmap, &details);
23832383
if (unlikely(!list_empty(&mapping->i_mmap_nonlinear)))
23842384
unmap_mapping_range_list(&mapping->i_mmap_nonlinear, &details);
2385-
i_mmap_unlock_write(mapping);
2385+
i_mmap_unlock_read(mapping);
23862386
}
23872387
EXPORT_SYMBOL(unmap_mapping_range);
23882388

0 commit comments

Comments
 (0)