Skip to contentSkip to conversation

mm-vma-clean-up-__vma_enter-exit_locked.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jan 31

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/vma: clean up __vma_enter/exit_locked()
has been removed from the -mm tree. Its filename was
mm-vma-clean-up-__vma_enter-exit_locked.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/vma: clean up __vma_enter/exit_locked()
Date: Fri, 23 Jan 2026 20:12:16 +0000

These functions are very confusing indeed. 'Entering' a lock could be interpreted as acquiring it, but this is not what these functions are interacting with.

Equally they don't indicate at all what kind of lock we are 'entering' or 'exiting'. Finally they are misleading as we invoke these functions when we already hold a write lock to detach a VMA.

These functions are explicitly simply 'entering' and 'exiting' a state in which we hold the EXCLUSIVE lock in order that we can either mark the VMA as being write-locked, or mark the VMA detached.

Rename the functions accordingly, and also update __vma_end_exclude_readers() to return detached state with a __must_check directive, as it is simply clumsy to pass an output pointer here to detached state and inconsistent vs. __vma_start_exclude_readers().

Finally, remove the unnecessary 'inline' directives.

No functional change intended.

---

 include/linux/mmap_lock.h |    4 +-
 mm/mmap_lock.c            |   58 ++++++++++++++++++++++++------------
 2 files changed, 42 insertions(+), 20 deletions(-)
include/linux/mmap_lock.h renamed from include/linux/mmap_lock.h~mm-vma-clean-up-__vma_enter-exit_locked +2 -2
@@ -211,8 +211,8 @@ static inline void vma_refcount_put(stru
 	newcnt = __vma_refcount_put_return(vma);
 
 	/*
-	 * __vma_enter_locked() may be sleeping waiting for readers to drop
-	 * their reference count, so wake it up if we were the last reader
+	 * __vma_start_exclude_readers() may be sleeping waiting for readers to
+	 * drop their reference count, so wake it up if we were the last reader
 	 * blocking it from being acquired.
 	 *
 	 * We may be raced by other readers temporarily incrementing the
mm/mmap_lock.c renamed from mm/mmap_lock.c~mm-vma-clean-up-__vma_enter-exit_locked +40 -18

103 lines not on this page · raw message

_

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

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-secretmem-to-use-vma-flags-on-mmap_prepare-fix.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-separate-out-vma_internalh-into-logical-headers-fix.patch tools-testing-vma-add-vma-userland-tests-for-vma-flag-functions.patch