Skip to contentSkip to conversation

mm-move-internal-core-vma-manipulation-functions-to-own-file.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Sep 2, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: move internal core VMA manipulation functions to own file
has been removed from the -mm tree. Its filename was
mm-move-internal-core-vma-manipulation-functions-to-own-file.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: Lorenzo Stoakes <[email protected]>
Subject: mm: move internal core VMA manipulation functions to own file
Date: Mon, 29 Jul 2024 12:50:38 +0100

This patch introduces vma.c and moves internal core VMA manipulation functions to this file from mmap.c.

This allows us to isolate VMA functionality in a single place such that we can create userspace testing code that invokes this functionality in an environment where we can implement simple unit tests of core functionality.

This patch ensures that core VMA functionality is explicitly marked as such by its presence in mm/vma.h.

It also places the header includes required by vma.c in vma_internal.h, which is simply imported by vma.c. This makes the VMA functionality testable, as userland testing code can simply stub out functionality as required.

---

 include/linux/mm.h |   35 
 mm/Makefile        |    2 
 mm/internal.h      |  236 -----
 mm/mmap.c          | 1772 -------------------------------------------
 mm/mmu_notifier.c  |    2 
 mm/vma.c           | 1766 ++++++++++++++++++++++++++++++++++++++++++
 mm/vma.h           |  364 ++++++++
 mm/vma_internal.h  |   50 +
 8 files changed, 2188 insertions(+), 2039 deletions(-)
include/linux/mm.h renamed from include/linux/mm.h~mm-move-internal-core-vma-manipulation-functions-to-own-file +0 -35
@@ -1005,21 +1005,6 @@ static inline struct vm_area_struct *vma
 	return mas_prev(&vmi->mas, 0);
 }
 
-static inline unsigned long vma_iter_addr(struct vma_iterator *vmi)
-{
-	return vmi->mas.index;
-}
-
-static inline unsigned long vma_iter_end(struct vma_iterator *vmi)
-{
-	return vmi->mas.last + 1;
-}
-static inline int vma_iter_bulk_alloc(struct vma_iterator *vmi,
-				      unsigned long count)
-{
-	return mas_expected_entries(&vmi->mas, count);
-}
-
 static inline int vma_iter_clear_gfp(struct vma_iterator *vmi,
 			unsigned long start, unsigned long end, gfp_t gfp)
 {
@@ -2534,21 +2519,6 @@ int get_cmdline(struct task_struct *task
 #define  MM_CP_UFFD_WP_ALL                 (MM_CP_UFFD_WP | \
 					    MM_CP_UFFD_WP_RESOLVE)
 
-bool vma_needs_dirty_tracking(struct vm_area_struct *vma);
-bool vma_wants_writenotify(struct vm_area_struct *vma, pgprot_t vm_page_prot);
-static inline bool vma_wants_manual_pte_write_upgrade(struct vm_area_struct *vma)
-{
-	/*
-	 * We want to check manually if we can change individual PTEs writable
-	 * if we can't do that automatically for all PTEs in a mapping. For
-	 * private mappings, that's always the case when we have write
-	 * permissions as we properly have to handle COW.
-	 */
-	if (vma->vm_flags & VM_SHARED)
-		return vma_wants_writenotify(vma, vma->vm_page_prot);
-	return !!(vma->vm_flags & VM_WRITE);
-
-}
 bool can_change_pte_writable(struct vm_area_struct *vma, unsigned long addr,
 			     pte_t pte);
 extern long change_protection(struct mmu_gather *tlb,
@@ -3256,12 +3226,7 @@ void anon_vma_interval_tree_verify(struc
 
 /* mmap.c */
 extern int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin);
-extern struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *);
 extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *);
-extern void unlink_file_vma(struct vm_area_struct *);
-extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
-	unsigned long addr, unsigned long len, pgoff_t pgoff,
-	bool *need_rmap_locks);
 extern void exit_mmap(struct mm_struct *);
 int relocate_vma_down(struct vm_area_struct *vma, unsigned long shift);
 
mm/internal.h renamed from mm/internal.h~mm-move-internal-core-vma-manipulation-functions-to-own-file +5 -231

273 lines not on this page · raw message

mm/Makefile renamed from mm/Makefile~mm-move-internal-core-vma-manipulation-functions-to-own-file +1 -1
@@ -37,7 +37,7 @@ mmu-y			:= nommu.o
 mmu-$(CONFIG_MMU)	:= highmem.o memory.o mincore.o \
 			   mlock.o mmap.o mmu_gather.o mprotect.o mremap.o \
 			   msync.o page_vma_mapped.o pagewalk.o \
-			   pgtable-generic.o rmap.o vmalloc.o
+			   pgtable-generic.o rmap.o vmalloc.o vma.o
 
 
 ifdef CONFIG_CROSS_MEMORY_ATTACH
mm/mmap.c renamed from mm/mmap.c~mm-move-internal-core-vma-manipulation-functions-to-own-file +0 -1772

1,814 lines not on this page · raw message

mm/mmu_notifier.c renamed from mm/mmu_notifier.c~mm-move-internal-core-vma-manipulation-functions-to-own-file +2 -0
@@ -19,6 +19,8 @@
 #include <linux/sched/mm.h>
 #include <linux/slab.h>
 
+#include "vma.h"
+
 /* global SRCU for all MMs */
 DEFINE_STATIC_SRCU(srcu);
 
mm/vma.c new file +1766 -0

843 lines not on this page · raw message

mm/vma.h new file +364 -0

364 lines not on this page · raw message

mm/vma_internal.h new file +50 -0

50 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

_

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

tools-improve-vma-test-makefile.patch tools-add-vma-merge-tests.patch mm-introduce-vma_merge_struct-and-abstract-vma_mergevma_modify.patch mm-remove-duplicated-open-coded-vma-policy-check.patch mm-abstract-vma_expand-to-use-vma_merge_struct.patch mm-avoid-using-vma_merge-for-new-vmas.patch mm-make-vma_prepare-and-friends-static-and-internal-to-vmac.patch mm-introduce-commit_merge-abstracting-final-commit-of-merge.patch mm-refactor-vma_merge-into-modify-only-vma_merge_existing_range.patch mm-rework-vm_ops-close-handling-on-vma-merge.patch

Part of the diff is not shown here. View the raw message.