Skip to contentSkip to conversation

selftests-vm-add-process_mrelease-tests.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message May 25, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: selftests: vm: add process_mrelease tests
has been removed from the -mm tree. Its filename was
selftests-vm-add-process_mrelease-tests.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: Suren Baghdasaryan <[email protected]>
Subject: selftests: vm: add process_mrelease tests
Date: Wed, 18 May 2022 13:43:16 -0700

Introduce process_mrelease syscall sanity tests which include tests which expect to fail:

- process_mrelease with invalid pidfd and flags inputs
- process_mrelease on a live process with no pending signals

and valid process_mrelease usage which is expected to succeed. Because process_mrelease has to be used against a process with a pending SIGKILL, it's possible that the process exits before process_mrelease gets called. In such cases we retry the test with a victim that allocates twice more memory up to 1GB. This would require the victim process to spend more time during exit and process_mrelease has a better chance of catching the process before it exits and succeeding.

On success the test reports the amount of memory the child had to allocate for reaping to succeed. Sample output:

$ mrelease_test
Success reaping a child with 1MB of memory allocations

On failure the test reports the failure. Sample outputs:

$ mrelease_test
All process_mrelease attempts failed!
$ mrelease_test
process_mrelease: Invalid argument
Cc Michal Hocko <[email protected]>
Cc David Rientjes <[email protected]>
Cc Matthew Wilcox (Oracle) <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Roman Gushchin <[email protected]>
Cc Minchan Kim <[email protected]>
Cc "Kirill A . Shutemov" <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Oleg Nesterov <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Jann Horn <[email protected]>
Cc Shakeel Butt <[email protected]>
Cc Peter Xu <[email protected]>
Cc John Hubbard <[email protected]>

---

 tools/testing/selftests/vm/.gitignore      |    1 
 tools/testing/selftests/vm/Makefile        |    1 
 tools/testing/selftests/vm/mrelease_test.c |  200 +++++++++++++++++++
 tools/testing/selftests/vm/run_vmtests.sh  |    2 
 4 files changed, 204 insertions(+)
tools/testing/selftests/vm/.gitignore renamed from tools/testing/selftests/vm/.gitignore~selftests-vm-add-process_mrelease-tests +1 -0
@@ -10,6 +10,7 @@ map_populate
 thuge-gen
 compaction_test
 mlock2-tests
+mrelease_test
 mremap_dontunmap
 mremap_test
 on-fault-limit
tools/testing/selftests/vm/Makefile renamed from tools/testing/selftests/vm/Makefile~selftests-vm-add-process_mrelease-tests +1 -0
@@ -44,6 +44,7 @@ TEST_GEN_FILES += memfd_secret
 TEST_GEN_FILES += migration
 TEST_GEN_FILES += mlock-random-test
 TEST_GEN_FILES += mlock2-tests
+TEST_GEN_FILES += mrelease_test
 TEST_GEN_FILES += mremap_dontunmap
 TEST_GEN_FILES += mremap_test
 TEST_GEN_FILES += on-fault-limit
tools/testing/selftests/vm/mrelease_test.c new file +200 -0

200 lines not on this page · raw message

tools/testing/selftests/vm/run_vmtests.sh renamed from tools/testing/selftests/vm/run_vmtests.sh~selftests-vm-add-process_mrelease-tests +2 -0
@@ -141,6 +141,8 @@ run_test ./mlock-random-test
 
 run_test ./mlock2-tests
 
+run_test ./mrelease_test
+
 run_test ./mremap_test
 
 run_test ./thuge-gen

_

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