Skip to contentSkip to conversation

mm-use-vma_iter_clear_gfp-in-nommu.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Aug 11, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: use vma_iter_clear_gfp() in nommu
has been removed from the -mm tree. Its filename was
mm-use-vma_iter_clear_gfp-in-nommu.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: use vma_iter_clear_gfp() in nommu
Date: Mon, 24 Jul 2023 14:31:51 -0400

Move the definition of vma_iter_clear_gfp() from mmap.c to internal.h so it can be used in the nommu code. This will reduce node preallocations in nommu.

---

 mm/internal.h |   12 ++++++++++++
 mm/mmap.c     |   12 ------------
 mm/nommu.c    |   12 ++++--------
 3 files changed, 16 insertions(+), 20 deletions(-)
mm/internal.h renamed from mm/internal.h~mm-use-vma_iter_clear_gfp-in-nommu +12 -0
@@ -1064,6 +1064,18 @@ static inline void vma_iter_clear(struct
 	mas_store_prealloc(&vmi->mas, NULL);
 }
 
+static inline int vma_iter_clear_gfp(struct vma_iterator *vmi,
+			unsigned long start, unsigned long end, gfp_t gfp)
+{
+	vmi->mas.index = start;
+	vmi->mas.last = end - 1;
+	mas_store_gfp(&vmi->mas, NULL, gfp);
+	if (unlikely(mas_is_err(&vmi->mas)))
+		return -ENOMEM;
+
+	return 0;
+}
+
 static inline struct vm_area_struct *vma_iter_load(struct vma_iterator *vmi)
 {
 	return mas_walk(&vmi->mas);
mm/mmap.c renamed from mm/mmap.c~mm-use-vma_iter_clear_gfp-in-nommu +0 -12
@@ -154,18 +154,6 @@ static inline struct vm_area_struct *vma
 	return mas_prev(&vmi->mas, min);
 }
 
-static inline int vma_iter_clear_gfp(struct vma_iterator *vmi,
-			unsigned long start, unsigned long end, gfp_t gfp)
-{
-	vmi->mas.index = start;
-	vmi->mas.last = end - 1;
-	mas_store_gfp(&vmi->mas, NULL, gfp);
-	if (unlikely(mas_is_err(&vmi->mas)))
-		return -ENOMEM;
-
-	return 0;
-}
-
 /*
  * check_brk_limits() - Use platform specific check of range & verify mlock
  * limits.
mm/nommu.c renamed from mm/nommu.c~mm-use-vma_iter_clear_gfp-in-nommu +4 -8
@@ -1396,17 +1396,13 @@ static int vmi_shrink_vma(struct vma_ite
 
 	/* adjust the VMA's pointers, which may reposition it in the MM's tree
 	 * and list */
-	if (vma_iter_prealloc(vmi)) {
-		pr_warn("Allocation of vma tree for process %d failed\n",
-		       current->pid);
-		return -ENOMEM;
-	}
-
 	if (from > vma->vm_start) {
-		vma_iter_clear(vmi, from, vma->vm_end);
+		if (vma_iter_clear_gfp(vmi, from, vma->vm_end, GFP_KERNEL))
+			return -ENOMEM;
 		vma->vm_end = from;
 	} else {
-		vma_iter_clear(vmi, vma->vm_start, to);
+		if (vma_iter_clear_gfp(vmi, vma->vm_start, to, GFP_KERNEL))
+			return -ENOMEM;
 		vma->vm_start = to;
 	}
 

_

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

maple_tree-add-hex-output-to-maple_arange64-dump.patch maple_tree-reorder-replacement-of-nodes-to-avoid-live-lock.patch maple_tree-introduce-mas_put_in_tree.patch maple_tree-introduce-mas_tree_parent-definition.patch maple_tree-change-mas_adopt_children-parent-usage.patch maple_tree-replace-data-before-marking-dead-in-split-and-spanning-store.patch