Skip to contentSkip to conversation

thp: run vma_adjust_trans_huge() outside i_mmap_rwsem

PATCH New [email protected] 1 participant 1 message Jul 26, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 99/126 thp: run vma_adjust_trans_huge() outside i_mmap_rwsem

From: "Kirill A. Shutemov" <[email protected]>
Subject: 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.

---

 mm/mmap.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/mmap.c renamed from mm/mmap.c~thp-run-vma_adjust_trans_huge-outside-i_mmap_rwsem +2 -1
diff -puN mm/mmap.c~thp-run-vma_adjust_trans_huge-outside-i_mmap_rwsem mm/mmap.c
@@ -675,6 +675,8 @@ again:			remove_next = 1 + (end > next->
 		}
 	}
 
+	vma_adjust_trans_huge(vma, start, end, adjust_next);
+
 	if (file) {
 		mapping = file->f_mapping;
 		root = &mapping->i_mmap;
@@ -695,8 +697,6 @@ again:			remove_next = 1 + (end > next->
 		}
 	}
 
-	vma_adjust_trans_huge(vma, start, end, adjust_next);