tools-testing-vma-add-unit-tests-flag-empty-diff_pair-and.patch removed from -mm tree
The quilt patch titled
Subject: tools/testing/vma: add unit tests flag empty, diff_pair, and[_mask]
has been removed from the -mm tree. Its filename was
tools-testing-vma-add-unit-tests-flag-empty-diff_pair-and.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: tools/testing/vma: add unit tests flag empty, diff_pair, and[_mask]
Date: Fri, 20 Mar 2026 19:38:19 +0000
Add VMA unit tests to assert that:
* vma_flags_empty()
* vma_flags_diff_pair()
* vma_flags_and_mask()
* vma_flags_and()
All function as expected.
In additional to the added tests, in order to make testing easier, add vma_flags_same_mask() and vma_flags_same() for testing only. If/when these are required in kernel code, they can be moved over.
Also add ASSERT_FLAGS_[NOT_]SAME[_MASK](), ASSERT_FLAGS_[NON]EMPTY() test helpers to make asserting flag state easier and more convenient.
---
tools/testing/vma/include/custom.h | 12 ++ tools/testing/vma/shared.h | 18 +++ tools/testing/vma/tests/vma.c | 137 +++++++++++++++++++++++++++ 3 files changed, 167 insertions(+)
tools/testing/vma/include/custom.h renamed from tools/testing/vma/include/custom.h~tools-testing-vma-add-unit-tests-flag-empty-diff_pair-and +12 -0
@@ -120,3 +120,15 @@ static inline unsigned long vma_kernel_p {return 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__))
tools/testing/vma/shared.h renamed from tools/testing/vma/shared.h~tools-testing-vma-add-unit-tests-flag-empty-diff_pair-and +18 -0
@@ -35,6 +35,24 @@#define ASSERT_EQ (_val1, _val2) ASSERT_TRUE((_val1) == (_val2))#define ASSERT_NE (_val1, _val2) ASSERT_TRUE((_val1) != (_val2)) +#define ASSERT_FLAGS_SAME_MASK (_flags, _flags_other) \ + ASSERT_TRUE(vma_flags_same_mask((_flags), (_flags_other))) + +#define ASSERT_FLAGS_NOT_SAME_MASK (_flags, _flags_other) \ + ASSERT_FALSE(vma_flags_same_mask((_flags), (_flags_other))) + +#define ASSERT_FLAGS_SAME (_flags, ...) \ + ASSERT_TRUE(vma_flags_same(_flags, __VA_ARGS__)) + +#define ASSERT_FLAGS_NOT_SAME (_flags, ...) \ + ASSERT_FALSE(vma_flags_same(_flags, __VA_ARGS__)) + +#define ASSERT_FLAGS_EMPTY (_flags) \ + ASSERT_TRUE(vma_flags_empty(_flags)) + +#define ASSERT_FLAGS_NONEMPTY (_flags) \ + ASSERT_FALSE(vma_flags_empty(_flags)) +#define IS_SET (_val, _flags) ((_val & _flags) == _flags)extern bool fail_prealloc;
tools/testing/vma/tests/vma.c renamed from tools/testing/vma/tests/vma.c~tools-testing-vma-add-unit-tests-flag-empty-diff_pair-and +137 -0
147 lines not on this page · raw message
_
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