mm-vma-introduce-vma_flags_same.patch removed from -mm tree
The quilt patch titled
Subject: mm/vma: introduce vma_flags_same[_mask/_pair]()
has been removed from the -mm tree. Its filename was
mm-vma-introduce-vma_flags_same.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 (Oracle)" <[email protected]>
Subject: mm/vma: introduce vma_flags_same[_mask/_pair]()
Date: Fri, 20 Mar 2026 19:38:27 +0000
Add helpers to determine if two sets of VMA flags are precisely the same, that is - that every flag set one is set in another, and neither contain any flags not set in the other.
We also introduce vma_flags_same_pair() for cases where we want to compare two sets of VMA flags which are both non-const values.
Also update the VMA tests to reflect the change, we already implicitly test that this functions correctly having used it for testing purposes previously.
---
include/linux/mm.h | 28 +++++++++++++++++++++++++++ tools/testing/vma/include/custom.h | 11 ---------- tools/testing/vma/include/dup.h | 21 ++++++++++++++++++++ 3 files changed, 49 insertions(+), 11 deletions(-)
include/linux/mm.h renamed from include/linux/mm.h~mm-vma-introduce-vma_flags_same +28 -0
@@ -1202,6 +1202,34 @@ static __always_inline vma_flags_t vma_freturn dst; } +/* Determine if flags and flags_other have precisely the same flags set. */ +static __always_inline bool vma_flags_same_pair(const vma_flags_t *flags, +const vma_flags_t *flags_other) +{ +const unsigned long *bitmap = flags->__vma_flags; +const unsigned long *bitmap_other = flags_other->__vma_flags; + +return bitmap_equal (bitmap, bitmap_other,NUM_VMA_FLAG_BITS ); +} + +/* Determine if flags and flags_other have precisely the same flags set. */ +static __always_inline bool vma_flags_same_mask(const vma_flags_t *flags, +vma_flags_t flags_other) +{ +const unsigned long *bitmap = flags->__vma_flags; +const unsigned long *bitmap_other = flags_other.__vma_flags; + +return bitmap_equal (bitmap, bitmap_other,NUM_VMA_FLAG_BITS ); +} + +/* +* Helper macro to determine if only the specific flags are set, e.g.: +* +* if (vma_flags_same(&flags, VMA_WRITE_BIT) { ... } +*/ +#define vma_flags_same (flags, ...) \ + vma_flags_same_mask(flags, mk_vma_flags(__VA_ARGS__)) +/* * Helper to test that ALL specified flags are set in a VMA. *
tools/testing/vma/include/custom.h renamed from tools/testing/vma/include/custom.h~mm-vma-introduce-vma_flags_same +0 -11
@@ -102,16 +102,5 @@ static inline unsigned long vma_kernel_preturn PAGE_SIZE ; } -/* Place here until needed in the kernel code. */ -static __always_inline bool vma_flags_same_mask(vma_flags_t *flags, -vma_flags_t flags_other) -{ -const unsigned long *bitmap = flags->__vma_flags; -const unsigned long *bitmap_other = flags_other.__vma_flags; - -return bitmap_equal (bitmap, bitmap_other,NUM_VMA_FLAG_BITS ); -} -#define vma_flags_same (flags, ...) \ - vma_flags_same_mask(flags, mk_vma_flags(__VA_ARGS__))#define VMA_SPECIAL_FLAGS mk_vma_flags(VMA_IO_BIT, VMA_DONTEXPAND_BIT, \ VMA_PFNMAP_BIT, VMA_MIXEDMAP_BIT)
tools/testing/vma/include/dup.h renamed from tools/testing/vma/include/dup.h~mm-vma-introduce-vma_flags_same +21 -0
@@ -954,6 +954,27 @@ static __always_inline vma_flags_t vma_freturn dst; } +static __always_inline bool vma_flags_same_pair(const vma_flags_t *flags, +const vma_flags_t *flags_other) +{ +const unsigned long *bitmap = flags->__vma_flags; +const unsigned long *bitmap_other = flags_other->__vma_flags; + +return bitmap_equal (bitmap, bitmap_other,NUM_VMA_FLAG_BITS ); +} + +static __always_inline bool vma_flags_same_mask(const vma_flags_t *flags, +vma_flags_t flags_other) +{ +const unsigned long *bitmap = flags->__vma_flags; +const unsigned long *bitmap_other = flags_other.__vma_flags; + +return bitmap_equal (bitmap, bitmap_other,NUM_VMA_FLAG_BITS ); +} + +#define vma_flags_same (flags, ...) \ + vma_flags_same_mask(flags, mk_vma_flags(__VA_ARGS__)) +static inline bool vma_test_all_mask (const struct vm_area_struct *vma,vma_flags_t flags) {
_
Patches currently in -mm which might be from [email protected] are
maintainers-update-mglru-entry-to-reflect-current-status.patch selftests-mm-add-merge-test-for-partial-msealed-range.patch