[RFC PATCH 08/28] mm/khugepaged: mark VMA as locked while collapsing a hugepage
From: Suren Baghdasaryan
Date: Mon Aug 29 2022 - 17:26:33 EST
Protect VMA from concurrent page fault handler while modifying it in
collapse_huge_page.
Signed-off-by: Suren Baghdasaryan <surenb@xxxxxxxxxx>
---
mm/khugepaged.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 01f71786d530..030680633989 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -1072,6 +1072,7 @@ static void collapse_huge_page(struct mm_struct *mm,
if (mm_find_pmd(mm, address) != pmd)
goto out_up_write;
+ vma_mark_locked(vma);
anon_vma_lock_write(vma->anon_vma);
mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, NULL, mm,
--
2.37.2.672.g94769d06f0-goog