Skip to contentSkip to conversation

mm-prevent-do_swap_page-from-handling-page-faults-under-vma-lock.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Apr 6, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: prevent do_swap_page from handling page faults under VMA lock
has been removed from the -mm tree. Its filename was
mm-prevent-do_swap_page-from-handling-page-faults-under-vma-lock.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Suren Baghdasaryan <[email protected]>
Subject: mm: prevent do_swap_page from handling page faults under VMA lock
Date: Mon, 27 Feb 2023 09:36:25 -0800

Due to the possibility of do_swap_page dropping mmap_lock, abort fault handling under VMA lock and retry holding mmap_lock. This can be handled more gracefully in the future.

---

 mm/memory.c |    5 +++++
 1 file changed, 5 insertions(+)
mm/memory.c renamed from mm/memory.c~mm-prevent-do_swap_page-from-handling-page-faults-under-vma-lock +5 -0
@@ -3697,6 +3697,11 @@ vm_fault_t do_swap_page(struct vm_fault
 	if (!pte_unmap_same(vmf))
 		goto out;
 
+	if (vmf->flags & FAULT_FLAG_VMA_LOCK) {
+		ret = VM_FAULT_RETRY;
+		goto out;
+	}
+
 	entry = pte_to_swp_entry(vmf->orig_pte);
 	if (unlikely(non_swap_entry(entry))) {
 		if (is_migration_entry(entry)) {

_

Patches currently in -mm which might be from [email protected] are