mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
mm: convert i_mmap_mutex to rwsem
The i_mmap_mutex is a close cousin of the anon vma lock, both protecting similar data, one for file backed pages and the other for anon memory. To this end, this lock can also be a rwsem. In addition, there are some important opportunities to share the lock when there are no tree modifications. This conversion is straightforward. For now, all users take the write lock. [[email protected]: update fremap.c] Signed-off-by: Davidlohr Bueso <[email protected]> Reviewed-by: Rik van Riel <[email protected]> Acked-by: "Kirill A. Shutemov" <[email protected]> Acked-by: Hugh Dickins <[email protected]> Cc: Oleg Nesterov <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Cc: Srikar Dronamraju <[email protected]> Acked-by: Mel Gorman <[email protected]> Signed-off-by: Stephen Rothwell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
83cde9e8ba
commit
c8c06efa8b
10 changed files with 30 additions and 29 deletions
|
|
@ -731,7 +731,7 @@ build_map_info(struct address_space *mapping, loff_t offset, bool is_register)
|
|||
|
||||
if (!prev && !more) {
|
||||
/*
|
||||
* Needs GFP_NOWAIT to avoid i_mmap_mutex recursion through
|
||||
* Needs GFP_NOWAIT to avoid i_mmap_rwsem recursion through
|
||||
* reclaim. This is optimistic, no harm done if it fails.
|
||||
*/
|
||||
prev = kmalloc(sizeof(struct map_info),
|
||||
|
|
|
|||
Loading…
Reference in a new issue