linux/tools/testing/selftests/vm
Joel Savitz 85463321e7 selftests/vm: enable running select groups of tests
Our memory management kernel CI testing at Red Hat uses the VM
selftests and we have run into two problems:

First, our LTP tests overlap with the VM selftests.

We want to avoid unhelpful redundancy in our testing practices.

Second, we have observed the current run_vmtests.sh to report overall
failure/ambiguous results in the case that a machine lacks the necessary
hardware to perform one or more of the tests. E.g. ksm tests that
require more than one numa node.

We want to be able to run the vm selftests suitable to particular hardware.

Add the ability to run one or more groups of vm tests via run_vmtests.sh
instead of simply all-or-none in order to solve these problems.

Preserve existing default behavior of running all tests when the script
is invoked with no arguments.

Documentation of test groups is included in the patch as follows:

    # ./run_vmtests.sh [ -h || --help ]

    usage: ./tools/testing/selftests/vm/run_vmtests.sh [ -h | -t "<categories>"]
      -t: specify specific categories to tests to run
      -h: display this message

    The default behavior is to run all tests.

    Alternatively, specific groups tests can be run by passing a string
    to the -t argument containing one or more of the following categories
    separated by spaces:
    - mmap
	    tests for mmap(2)
    - gup_test
	    tests for gup using gup_test interface
    - userfaultfd
	    tests for  userfaultfd(2)
    - compaction
	    a test for the patch "Allow compaction of unevictable pages"
    - mlock
	    tests for mlock(2)
    - mremap
	    tests for mremap(2)
    - hugevm
	    tests for very large virtual address space
    - vmalloc
	    vmalloc smoke tests
    - hmm
	    hmm smoke tests
    - madv_populate
	    test memadvise(2) MADV_POPULATE_{READ,WRITE} options
    - memfd_secret
	    test memfd_secret(2)
    - process_mrelease
	    test process_mrelease(2)
    - ksm
	    ksm tests that do not require >=2 NUMA nodes
    - ksm_numa
	    ksm tests that require >=2 NUMA nodes
    - pkey
	    memory protection key tests
    - soft_dirty
    	    test soft dirty page bit semantics
    - anon_cow
            test anonymous copy-on-write semantics
    example: ./run_vmtests.sh -t "hmm mmap ksm"

Link: https://lkml.kernel.org/r/20221018231222.1884715-1-jsavitz@redhat.com
Signed-off-by: Joel Savitz <jsavitz@redhat.com>
Cc: Joel Savitz <jsavitz@redhat.com>
Cc: Nico Pache <npache@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-12-11 18:12:07 -08:00
..
.gitignore selftests/vm: anon_cow: prepare for non-anonymous COW tests 2022-11-30 15:58:56 -08:00
charge_reserved_hugetlb.sh selftests/vm: make charge_reserved_hugetlb.sh work with existing cgroup setting 2022-01-15 16:30:30 +02:00
check_config.sh selftests/vm: anon_cow: prepare for non-anonymous COW tests 2022-11-30 15:58:56 -08:00
compaction_test.c selftests/vm: 8x compaction_test speedup 2020-10-13 18:38:34 -07:00
config selftests: vm: add test for Soft-Dirty PTE bit 2022-04-28 23:16:11 -07:00
cow.c selftests/vm: cow: R/O long-term pinning reliability tests for non-anon pages 2022-11-30 15:58:57 -08:00
gup_test.c selftests/vm: use top_srcdir instead of recomputing relative paths 2022-10-05 11:05:17 -06:00
hmm-tests.c - Alistair Popple has a series which addresses a race which causes page 2022-10-14 12:28:43 -07:00
hugepage-mmap.c selftests/vm: use memfd for hugepage-mmap test 2022-11-30 15:59:01 -08:00
hugepage-mremap.c selftests/vm: use memfd for hugepage-mremap test 2022-11-08 17:37:11 -08:00
hugepage-shm.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hugepage-vmemmap.c selftests: vm: add a hugetlb test case 2022-03-22 15:57:08 -07:00
hugetlb_reparenting_test.sh selftests/vm: make charge_reserved_hugetlb.sh work with existing cgroup setting 2022-01-15 16:30:30 +02:00
hugetlb-madvise.c selftests/vm: update hugetlb madvise 2022-11-30 15:58:46 -08:00
khugepaged.c selftests/vm: add file/shmem MADV_COLLAPSE selftest for cleared pmd 2022-10-03 14:03:34 -07:00
ksm_tests.c selftests/vm: use top_srcdir instead of recomputing relative paths 2022-10-05 11:05:17 -06:00
madv_populate.c selftests/vm: factor out pagemap_is_populated() into vm_util 2022-11-08 17:37:14 -08:00
Makefile selftests/vm: anon_cow: prepare for non-anonymous COW tests 2022-11-30 15:58:56 -08:00
map_fixed_noreplace.c selftest/vm: fix map_fixed_noreplace test failure 2022-02-26 09:51:17 -08:00
map_hugetlb.c selftests/vm: fix display of page size in map_hugetlb 2020-09-19 13:13:39 -07:00
map_populate.c tools/testing/selftests/vm/: add MAP_POPULATE test 2018-08-22 10:52:45 -07:00
memfd_secret.c selftests: kselftest framework: provide "finished" helper 2022-03-24 19:06:51 -07:00
migration.c mm: add selftests for migration entries 2022-04-28 23:16:07 -07:00
mlock2-tests.c selftests: vm: drop dependencies on page flags from mlock2 tests 2020-04-02 09:35:31 -07:00
mlock2.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mlock-random-test.c selftests: Fix spelling mistake "cann't" -> "cannot" 2021-09-03 09:58:13 -07:00
mrelease_test.c selftests/vm: fix errno handling in mrelease_test 2022-07-29 18:07:14 -07:00
mremap_dontunmap.c selftests: add a MREMAP_DONTUNMAP selftest for shmem 2021-04-30 11:20:39 -07:00
mremap_test.c mm: add merging after mremap resize 2022-09-26 19:46:28 -07:00
on-fault-limit.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pkey-helpers.h selftests/vm: remove ARRAY_SIZE define from individual tests 2021-12-10 17:51:25 -07:00
pkey-powerpc.h selftests: vm: pkeys: use the correct page size on powerpc 2020-06-04 19:06:27 -07:00
pkey-x86.h selftests/vm/pkeys: Use provided __cpuid_count() macro 2022-04-25 15:12:52 -06:00
protection_keys.c selftests/vm/pkeys: fix typo in comment 2022-05-25 10:47:48 -07:00
run_vmtests.sh selftests/vm: enable running select groups of tests 2022-12-11 18:12:07 -08:00
settings selftests: vm: add the "settings" file with timeout variable 2022-05-25 10:47:49 -07:00
soft-dirty.c selftests/vm: dedup THP helpers 2022-10-03 14:03:34 -07:00
split_huge_page_test.c selftests/vm: dedup THP helpers 2022-10-03 14:03:34 -07:00
test_hmm.sh mm/hmm/test: use char dev with struct device to get device node 2022-10-03 14:03:03 -07:00
test_vmalloc.sh vm/test_vmalloc.sh: adapt for updated driver interface 2021-04-30 11:20:40 -07:00
thuge-gen.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
transhuge-stress.c selftest/vm: add util.h and and move helper functions there 2022-03-24 19:06:45 -07:00
userfaultfd.c selftests/vm: use memfd for uffd hugetlb tests 2022-11-08 17:37:11 -08:00
util.h selftest/vm: add helpers to detect PAGE_SIZE and PAGE_SHIFT 2022-03-24 19:06:45 -07:00
va_128TBswitch.c selftests/vm: skip 128TBswitch on unsupported arch 2022-07-29 18:07:14 -07:00
va_128TBswitch.sh selftests/vm: fix va_128TBswitch.sh permissions 2022-07-26 16:59:50 -07:00
virtual_address_range.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 191 2019-05-30 11:29:21 -07:00
vm_util.c selftests/vm: factor out pagemap_is_populated() into vm_util 2022-11-08 17:37:14 -08:00
vm_util.h selftests/vm: factor out pagemap_is_populated() into vm_util 2022-11-08 17:37:14 -08:00
write_hugetlb_memory.sh selftests/vm: make charge_reserved_hugetlb.sh work with existing cgroup setting 2022-01-15 16:30:30 +02:00
write_to_hugetlbfs.c selftests/vm/write_to_hugetlbfs.c: fix unused variable warning 2020-05-23 10:26:31 -07:00