Skip to contentSkip to conversation

selftest/vm: Move 128TB mmap boundary test to generic directory

PATCH Applied Aneesh Kumar K.V 3 participants 3 messages Nov 23, 2017 – Jan 8, 2018

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

PATCH v3 1/1 selftest/vm: Move 128TB mmap boundary test to generic directory

Architectures like ppc64 do support mmap hint addr based large address space selection. This test can be run on those architectures too. Move the test to selftest/vm so that other archs can use the same.

We also add a few new test scenarios in this patch. We do test few boundary condition before we do a high address mmap. ppc64 use the addr limit to validate addr in the fault path. We had bugs in this area w.r.t slb fault handling before we updated the addr limit.

We also touch the allocated space to make sure we don't have any bugs in the fault handling path.

---
Changes from V2:
* Rebase on top of -tip tree.
* update the correct license
* use memset to touch the full mmap range.

 tools/testing/selftests/vm/Makefile         |   1 +
 tools/testing/selftests/vm/run_vmtests      |  11 ++
 tools/testing/selftests/vm/va_128TBswitch.c | 297 ++++++++++++++++++++++++++++
 tools/testing/selftests/x86/5lvl.c          | 177 -----------------
 4 files changed, 309 insertions(+), 177 deletions(-)
 create mode 100644 tools/testing/selftests/vm/va_128TBswitch.c
 delete mode 100644 tools/testing/selftests/x86/5lvl.c
tools/testing/selftests/vm/Makefile +1 -0
index e49eca1915f8..f33f2d6d5014 100644
@@ -18,6 +18,7 @@ TEST_GEN_FILES += transhuge-stress
 TEST_GEN_FILES += userfaultfd
 TEST_GEN_FILES += mlock-random-test
 TEST_GEN_FILES += virtual_address_range
+TEST_GEN_FILES += va_128TBswitch
 
 TEST_PROGS := run_vmtests
 
tools/testing/selftests/vm/run_vmtests +11 -0
index cc826326de87..d2561895a021 100755
@@ -177,4 +177,15 @@ else
 	echo "[PASS]"
 fi
 
+echo "-----------------------------"
+echo "running virtual address 128TB switch test"
+echo "-----------------------------"
+./va_128TBswitch
+if [ $? -ne 0 ]; then
+    echo "[FAIL]"
+    exitcode=1
+else
+    echo "[PASS]"
+fi
+
 exit $exitcode
tools/testing/selftests/vm/va_128TBswitch.c new file +297 -0

297 lines not on this page · raw message

tools/testing/selftests/x86/5lvl.c deleted +0 -177

177 lines not on this page · raw message

Signature · 1 line
2.14.3
#1 lore raw

PATCH v4 1/1 selftest/vm: Move the 128 TB mmap boundary test to the generic VM directory

Quoted 19 lines · Aneesh Kumar K.V

Architectures like ppc64 do support mmap hint addr based large address space selection. This test can be run on those architectures too. Move the test to selftest/vm so that other archs can use the same.

We also add a few new test scenarios in this patch. We do test few boundary condition before we do a high address mmap. ppc64 use the addr limit to validate addr in the fault path. We had bugs in this area w.r.t slb fault handling before we updated the addr limit.

We also touch the allocated space to make sure we don't have any bugs in the fault handling path.

---
Changes from V2:
* Rebase on top of -tip tree.
* update the correct license
* use memset to touch the full mmap range.

Quoted 7 lines
 tools/testing/selftests/vm/Makefile         |   1 +
 tools/testing/selftests/vm/run_vmtests      |  11 ++
 tools/testing/selftests/vm/va_128TBswitch.c | 297 ++++++++++++++++++++++++++++
 tools/testing/selftests/x86/5lvl.c          | 177 -----------------
 4 files changed, 309 insertions(+), 177 deletions(-)
 create mode 100644 tools/testing/selftests/vm/va_128TBswitch.c
 delete mode 100644 tools/testing/selftests/x86/5lvl.c

This will now apply (almost) cleanly to Linus's latest tree - I fixed up a trivial conflict in selftests/vm/Makefile.

Note that I also improved the changelog.

Note #2: I'd suggest this patch to be split into two patches:

- patch 1 moves the testcase to vm/selftests
- patch 2 does all the additional improvements

because this way all the deltas will be much easier to see and review.

Thanks,

Ingo

=================>

#2 lore raw

Re: [PATCH v4] selftest/vm: Move the 128 TB mmap boundary test to the generic VM directory

Anesh,

Quoted 16 lines · Ingo Molnar
Quoted 13 lines · Aneesh Kumar K.V

Architectures like ppc64 do support mmap hint addr based large address space selection. This test can be run on those architectures too. Move the test to selftest/vm so that other archs can use the same.

We also add a few new test scenarios in this patch. We do test few boundary condition before we do a high address mmap. ppc64 use the addr limit to validate addr in the fault path. We had bugs in this area w.r.t slb fault handling before we updated the addr limit.

We also touch the allocated space to make sure we don't have any bugs in the fault handling path.

<snip>

Quoted 7 lines
tools/testing/selftests/vm/va_128TBswitch.c new file +4 -0
@@ -0,0 +1,297 @@
+/*
+ *
+ * Authors: Kirill A. Shutemov <[email protected]>
+ * Authors: Aneesh Kumar K.V <[email protected]>

tools/testing/selftests/vm/va_128TBswitch.c line 14

Quoted 10 lines
tools/testing/selftests/vm/va_128TBswitch.c new file +10 -0
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation.
+
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */

Would you mind using an SPDX tag instead of this fine legalese? See Thomas doc [1] for details.
Thanks!

[1] https://lkml.org/lkml/2017/12/28/323

Signature · 8 lines
Cordially
Philippe Ombredanne

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>