Skip to contentSkip to conversation

mm-mprotect-use-maple-tree-navigation-instead-of-vma-linked-list.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Sep 27, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/mprotect: use maple tree navigation instead of VMA linked list
has been removed from the -mm tree. Its filename was
mm-mprotect-use-maple-tree-navigation-instead-of-vma-linked-list.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: "Liam R. Howlett" <[email protected]>
Subject: mm/mprotect: use maple tree navigation instead of VMA linked list
Date: Tue, 6 Sep 2022 19:49:02 +0000

Switch to navigating the VMA list with the maple tree operators in preparation for removing the linked list.

Cc Catalin Marinas <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc David Howells <[email protected]>
Cc Davidlohr Bueso <[email protected]>
Cc "Matthew Wilcox (Oracle)" <[email protected]>
Cc SeongJae Park <[email protected]>
Cc Sven Schnelle <[email protected]>
Cc Will Deacon <[email protected]>

---

 mm/mprotect.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
mm/mprotect.c renamed from mm/mprotect.c~mm-mprotect-use-maple-tree-navigation-instead-of-vma-linked-list +5 -3
@@ -676,6 +676,7 @@ static int do_mprotect_pkey(unsigned lon
 	const bool rier = (current->personality & READ_IMPLIES_EXEC) &&
 				(prot & PROT_READ);
 	struct mmu_gather tlb;
+	MA_STATE(mas, &current->mm->mm_mt, 0, 0);
 
 	start = untagged_addr(start);
 
@@ -707,7 +708,8 @@ static int do_mprotect_pkey(unsigned lon
 	if ((pkey != -1) && !mm_pkey_is_allocated(current->mm, pkey))
 		goto out;
 
-	vma = find_vma(current->mm, start);
+	mas_set(&mas, start);
+	vma = mas_find(&mas, ULONG_MAX);
 	error = -ENOMEM;
 	if (!vma)
 		goto out;
@@ -733,7 +735,7 @@ static int do_mprotect_pkey(unsigned lon
 	if (start > vma->vm_start)
 		prev = vma;
 	else
-		prev = vma->vm_prev;
+		prev = mas_prev(&mas, 0);
 
 	tlb_gather_mmu(&tlb, current->mm);
 	for (nstart = start ; ; ) {
@@ -796,7 +798,7 @@ static int do_mprotect_pkey(unsigned lon
 		if (nstart >= end)
 			break;
 
-		vma = prev->vm_next;
+		vma = find_vma(current->mm, prev->vm_end);
 		if (!vma || vma->vm_start != nstart) {
 			error = -ENOMEM;
 			break;

_

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