Commit 37f9f559 authored by Kirill A. Shutemov's avatar Kirill A. Shutemov Committed by Linus Torvalds

thp: run vma_adjust_trans_huge() outside i_mmap_rwsem

vma_addjust_trans_huge() splits pmd if it's crossing VMA boundary.
During split we munlock the huge page which requires rmap walk.  rmap
wants to take the lock on its own.

Let's move vma_adjust_trans_huge() outside i_mmap_rwsem to fix this.

Link: http://lkml.kernel.org/r/1466021202-61880-19-git-send-email-kirill.shutemov@linux.intel.comSigned-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b237aded
...@@ -675,6 +675,8 @@ again: remove_next = 1 + (end > next->vm_end); ...@@ -675,6 +675,8 @@ again: remove_next = 1 + (end > next->vm_end);
} }
} }
vma_adjust_trans_huge(vma, start, end, adjust_next);
if (file) { if (file) {
mapping = file->f_mapping; mapping = file->f_mapping;
root = &mapping->i_mmap; root = &mapping->i_mmap;
...@@ -695,8 +697,6 @@ again: remove_next = 1 + (end > next->vm_end); ...@@ -695,8 +697,6 @@ again: remove_next = 1 + (end > next->vm_end);
} }
} }
vma_adjust_trans_huge(vma, start, end, adjust_next);
anon_vma = vma->anon_vma; anon_vma = vma->anon_vma;
if (!anon_vma && adjust_next) if (!anon_vma && adjust_next)
anon_vma = next->anon_vma; anon_vma = next->anon_vma;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment