Skip to contentSkip to conversation

mm: Add selftests for migration entries

PATCH Applied Alistair Popple 1 participant 1 message Mar 24, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: Add selftests for migration entries

Add some basic migration tests and in particular tests that will stress both the pte and pmd migration entry wait paths.

---

This is a clean-up of an ad-hoc test I had written to test and understand the migration entry code paths. I think it would also be useful to have upstream so these code paths could be more regularly and easily exerciesed.

For example these tests directly found an issue with linux-next f886cdb76920 ("mm: pvmw: add support for walking devmap pages").

 tools/testing/selftests/vm/Makefile    |   3 +
 tools/testing/selftests/vm/migration.c | 193 +++++++++++++++++++++++++
 2 files changed, 196 insertions(+)
 create mode 100644 tools/testing/selftests/vm/migration.c
tools/testing/selftests/vm/Makefile +3 -0
index a860daa75f60..4b7a6b0ee7db 100644
@@ -41,6 +41,7 @@ TEST_GEN_FILES += map_fixed_noreplace
 TEST_GEN_FILES += map_hugetlb
 TEST_GEN_FILES += map_populate
 TEST_GEN_FILES += memfd_secret
+TEST_GEN_FILES += migration
 TEST_GEN_FILES += mlock-random-test
 TEST_GEN_FILES += mlock2-tests
 TEST_GEN_FILES += mremap_dontunmap
@@ -149,6 +150,8 @@ $(OUTPUT)/hmm-tests: LDLIBS += $(HMM_EXTRA_LIBS)
 
 $(OUTPUT)/ksm_tests: LDLIBS += -lnuma
 
+$(OUTPUT)/migration: LDLIBS += -lnuma
+
 local_config.mk local_config.h: check_config.sh
 	/bin/sh ./check_config.sh $(CC)
 
tools/testing/selftests/vm/migration.c new file +193 -0

193 lines not on this page · raw message

Signature · 1 line
2.34.1