mm-rmap-separate-out-fork-only-logic-on-anon_vma_clone.patch removed from -mm tree
The quilt patch titled
Subject: mm/rmap: separate out fork-only logic on anon_vma_clone()
has been removed from the -mm tree. Its filename was
mm-rmap-separate-out-fork-only-logic-on-anon_vma_clone.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/rmap: separate out fork-only logic on anon_vma_clone()
Date: Sun, 18 Jan 2026 14:50:45 +0000
Specify which operation is being performed to anon_vma_clone(), which allows us to do checks specific to each operation type, as well as to separate out and make clear that the anon_vma reuse logic is absolutely specific to fork only.
This opens the door to further refactorings and refinements later as we have more information to work with.
---
mm/internal.h | 11 +++- mm/rmap.c | 74 +++++++++++++++++++---------- mm/vma.c | 6 +- tools/testing/vma/vma_internal.h | 11 +++- 4 files changed, 74 insertions(+), 28 deletions(-)
mm/internal.h renamed from mm/internal.h~mm-rmap-separate-out-fork-only-logic-on-anon_vma_clone +10 -1
@@ -244,7 +244,16 @@ static inline void anon_vma_unlock_read(struct anon_vma *folio_get_anon_vma (const struct folio *folio); -int anon_vma_clone (struct vm_area_struct *dst,struct vm_area_struct *src); +/* Operations which modify VMAs. */ +enum vma_operation { +VMA_OP_SPLIT , +VMA_OP_MERGE_UNFAULTED , +VMA_OP_REMAP , +VMA_OP_FORK , +}; + +int anon_vma_clone (struct vm_area_struct *dst,struct vm_area_struct *src, +enum vma_operation operation);int anon_vma_fork (struct vm_area_struct *vma,struct vm_area_struct *pvma);int __anon_vma_prepare (struct vm_area_struct *vma);void unlink_anon_vmas (struct vm_area_struct *vma);
mm/rmap.c renamed from mm/rmap.c~mm-rmap-separate-out-fork-only-logic-on-anon_vma_clone +51 -23
121 lines not on this page · raw message
mm/vma.c renamed from mm/vma.c~mm-rmap-separate-out-fork-only-logic-on-anon_vma_clone +3 -3
@@ -530,7 +530,7 @@ __split_vma(struct vma_iterator *vmi, stif (err) goto out_free_vmi; - err =anon_vma_clone (new, vma); + err =anon_vma_clone (new, vma,VMA_OP_SPLIT );if (err) goto out_free_mpol;
@@ -628,7 +628,7 @@ static int dup_anon_vma(struct vm_area_svma_assert_write_locked (dst); dst->anon_vma = src->anon_vma; - ret =anon_vma_clone (dst, src); + ret =anon_vma_clone (dst, src,VMA_OP_MERGE_UNFAULTED );if (ret)return ret;
@@ -1901,7 +1901,7 @@ struct vm_area_struct *copy_vma(struct vvma_set_range (new_vma, addr, addr + len, pgoff);if (vma_dup_policy (vma, new_vma)) goto out_free_vma; -if (anon_vma_clone (new_vma, vma)) +if (anon_vma_clone (new_vma, vma,VMA_OP_REMAP )) goto out_free_mempol;if (new_vma->vm_file)get_file (new_vma->vm_file);
tools/testing/vma/vma_internal.h renamed from tools/testing/vma/vma_internal.h~mm-rmap-separate-out-fork-only-logic-on-anon_vma_clone +10 -1
@@ -600,6 +600,14 @@ struct mmap_action { bool hide_from_rmap_until_complete :1; }; +/* Operations which modify VMAs. */ +enum vma_operation { +VMA_OP_SPLIT , +VMA_OP_MERGE_UNFAULTED , +VMA_OP_REMAP , +VMA_OP_FORK , +}; +/* * Describes a VMA that is about to be mmap()'ed. Drivers may choose to * manipulate mutable fields which will cause those fields to be updated in the
@@ -1157,7 +1165,8 @@ static inline int vma_dup_policy(structreturn 0 ; } -static inline int anon_vma_clone (struct vm_area_struct *dst,struct vm_area_struct *src) +static inline int anon_vma_clone (struct vm_area_struct *dst,struct vm_area_struct *src, +enum vma_operation operation) {/* For testing purposes. We indicate that an anon_vma has been cloned. */ if (src->anon_vma !=NULL ) {
_
Patches currently in -mm which might be from [email protected] are
selftests-mm-remove-virtual_address_range-test.patch mm-vma-rename-vma_lock_offset-to-vm_refcnt_exclude_readers_flag.patch mm-vma-document-possible-vma-vm_refcnt-values-and-reference-comment.patch mm-vma-rename-is_vma_write_only-separate-out-shared-refcount-put.patch mm-vma-adduse-vma-lockdep-acquire-release-defines.patch mm-vma-de-duplicate-__vma_enter_locked-error-path.patch mm-vma-clean-up-__vma_enter-exit_locked.patch mm-vma-introduce-helper-struct-thread-through-exclusive-lock-fns.patch mm-vma-improve-and-document-__is_vma_write_locked.patch mm-vma-improve-and-document-__is_vma_write_locked-fix.patch mm-vma-update-vma_assert_locked-to-use-lockdep.patch mm-vma-update-vma_assert_locked-to-use-lockdep-fix.patch mm-vma-add-and-use-vma_assert_stabilised.patch mm-vma-remove-__private-sparse-decoration-from-vma_flags_t.patch mm-rename-vma_flag_test-set_atomic-to-vma_test-set_atomic_flag.patch mm-add-mk_vma_flags-bitmap-flag-macro-helper.patch tools-bitmap-add-missing-bitmap_.patch mm-add-basic-vma-flag-operation-helper-functions.patch mm-update-hugetlbfs-to-use-vma-flags-on-mmap_prepare.patch mm-update-secretmem-to-use-vma-flags-on-mmap_prepare.patch mm-update-shmem__file_-functions-to-use-vma_flags_t.patch mm-update-all-remaining-mmap_prepare-users-to-use-vma_flags_t.patch mm-make-vm_area_desc-utilise-vma_flags_t-only.patch tools-testing-vma-separate-vma-userland-tests-into-separate-files.patch tools-testing-vma-separate-out-vma_internalh-into-logical-headers.patch tools-testing-vma-add-vma-userland-tests-for-vma-flag-functions.patch