Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8475d14 authored by Davidlohr Bueso's avatar Davidlohr Bueso Committed by Linus Torvalds
Browse files

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: default avatarDavidlohr Bueso <dbueso@suse.de>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Acked-by: default avatarHugh Dickins <hughd@google.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Acked-by: default avatarMel Gorman <mgorman@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1acf2e04
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2377,12 +2377,12 @@ void unmap_mapping_range(struct address_space *mapping,
		details.last_index = ULONG_MAX;


	i_mmap_lock_write(mapping);
	i_mmap_lock_read(mapping);
	if (unlikely(!RB_EMPTY_ROOT(&mapping->i_mmap)))
		unmap_mapping_range_tree(&mapping->i_mmap, &details);
	if (unlikely(!list_empty(&mapping->i_mmap_nonlinear)))
		unmap_mapping_range_list(&mapping->i_mmap_nonlinear, &details);
	i_mmap_unlock_write(mapping);
	i_mmap_unlock_read(mapping);
}
EXPORT_SYMBOL(unmap_mapping_range);