Skip to contentSkip to conversation

mm-remove-unnecessary-write-to-vma-iterator-in-__vma_adjust.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Feb 10, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: remove unnecessary write to vma iterator in __vma_adjust()
has been removed from the -mm tree. Its filename was
mm-remove-unnecessary-write-to-vma-iterator-in-__vma_adjust.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: remove unnecessary write to vma iterator in __vma_adjust()
Date: Fri, 20 Jan 2023 11:26:35 -0500

If the vma start address is going to change due to an insert, then it is safe to not write the vma to the tree. The write of the insert vma will alter the tree as necessary.

---

 mm/mmap.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
mm/mmap.c renamed from mm/mmap.c~mm-remove-unnecessary-write-to-vma-iterator-in-__vma_adjust +6 -4
@@ -719,10 +719,12 @@ int __vma_adjust(struct vma_iterator *vm
 	}
 
 	if (start != vma->vm_start) {
-		if ((vma->vm_start < start) &&
-		    (!insert || (insert->vm_end != start))) {
-			vma_iter_clear(vmi, vma->vm_start, start);
-			VM_WARN_ON(insert && insert->vm_start > vma->vm_start);
+		if (vma->vm_start < start) {
+			if (!insert || (insert->vm_end != start)) {
+				vma_iter_clear(vmi, vma->vm_start, start);
+				vma_iter_set(vmi, start);
+				VM_WARN_ON(insert && insert->vm_start > vma->vm_start);
+			}
 		} else {
 			vma_changed = true;
 		}

_

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