Skip to contentSkip to conversation

mm-mmap-convert-all-mas-except-mas_detach-to-vma-iterator.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Apr 26, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/mmap: convert all mas except mas_detach to vma iterator
has been removed from the -mm tree. Its filename was
mm-mmap-convert-all-mas-except-mas_detach-to-vma-iterator.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: Yajun Deng <[email protected]>
Subject: mm/mmap: convert all mas except mas_detach to vma iterator
Date: Mon, 25 Mar 2024 14:32:58 +0800

There are two types of iterators mas and vmi in the current code. If the maple tree comes from the mm structure, we can use the vma iterator. Avoid using mas directly as possible.

Keep using mas for the mt_detach tree, since it doesn't come from the mm structure.

Remove as many uses of mas as possible, but we will still have a few that must be passed through in unmap_vmas() and free_pgtables().

Also introduce vma_iter_reset, vma_iter_{prev, next}_range_limit and vma_iter_area_{lowest, highest} helper functions for using the vma interator.

---

 mm/internal.h |   29 ++++++++++++
 mm/mmap.c     |  113 +++++++++++++++++++++++-------------------------
 2 files changed, 85 insertions(+), 57 deletions(-)
mm/internal.h renamed from mm/internal.h~mm-mmap-convert-all-mas-except-mas_detach-to-vma-iterator +29 -0
@@ -1254,6 +1254,35 @@ static inline void vma_iter_config(struc
 	__mas_set_range(&vmi->mas, index, last - 1);
 }
 
+static inline void vma_iter_reset(struct vma_iterator *vmi)
+{
+	mas_reset(&vmi->mas);
+}
+
+static inline
+struct vm_area_struct *vma_iter_prev_range_limit(struct vma_iterator *vmi, unsigned long min)
+{
+	return mas_prev_range(&vmi->mas, min);
+}
+
+static inline
+struct vm_area_struct *vma_iter_next_range_limit(struct vma_iterator *vmi, unsigned long max)
+{
+	return mas_next_range(&vmi->mas, max);
+}
+
+static inline int vma_iter_area_lowest(struct vma_iterator *vmi, unsigned long min,
+				       unsigned long max, unsigned long size)
+{
+	return mas_empty_area(&vmi->mas, min, max - 1, size);
+}
+
+static inline int vma_iter_area_highest(struct vma_iterator *vmi, unsigned long min,
+					unsigned long max, unsigned long size)
+{
+	return mas_empty_area_rev(&vmi->mas, min, max - 1, size);
+}
+
 /*
  * VMA Iterator functions shared between nommu and mmap
  */
mm/mmap.c renamed from mm/mmap.c~mm-mmap-convert-all-mas-except-mas_detach-to-vma-iterator +56 -57

325 lines not on this page · raw message

_

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