diff options
author | Sri Jayaramappa <sjayaram@akamai.com> | 2015-04-23 14:21:41 -0400 |
---|---|---|
committer | Shuah Khan <shuahkh@osg.samsung.com> | 2015-05-26 15:58:06 -0600 |
commit | bd67d5c15cc190f52eb2f2a2f6f6b800ca33d9dd (patch) | |
tree | a562c98b5e48e543e2c367a319e9af67524ec9b5 /tools/testing/selftests/vm/run_vmtests | |
parent | d0bd7f2ac785468ee99e24a0e7b37420e5a242e8 (diff) | |
download | linux-bd67d5c15cc190f52eb2f2a2f6f6b800ca33d9dd.tar.gz linux-bd67d5c15cc190f52eb2f2a2f6f6b800ca33d9dd.tar.bz2 linux-bd67d5c15cc190f52eb2f2a2f6f6b800ca33d9dd.zip |
Test compaction of mlocked memory
Commit commit 5bbe3547aa3b ("mm: allow compaction of unevictable pages")
introduced a sysctl that allows userspace to enable scanning of locked
pages for compaction. This patch introduces a new test which fragments
main memory and attempts to allocate a number of huge pages to exercise
this compaction logic.
Tested on machines with up to 32 GB RAM. With the patch a much larger
number of huge pages can be allocated than on the kernel without the
patch.
Example output:
On a machine with 16 GB RAM:
sudo make run_tests vm
...
-----------------------
running compaction_test
-----------------------
No of huge pages allocated = 3834
[PASS]
...
Signed-off-by: Sri Jayaramappa <sjayaram@akamai.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-api@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Eric B Munson <emunson@akamai.com>
Reviewed-by: Eric B Munson <emunson@akamai.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/testing/selftests/vm/run_vmtests')
-rwxr-xr-x | tools/testing/selftests/vm/run_vmtests | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/testing/selftests/vm/run_vmtests b/tools/testing/selftests/vm/run_vmtests index c87b6812300d..49ece11ff7fd 100755 --- a/tools/testing/selftests/vm/run_vmtests +++ b/tools/testing/selftests/vm/run_vmtests @@ -90,4 +90,16 @@ fi umount $mnt rm -rf $mnt echo $nr_hugepgs > /proc/sys/vm/nr_hugepages + +echo "-----------------------" +echo "running compaction_test" +echo "-----------------------" +./compaction_test +if [ $? -ne 0 ]; then + echo "[FAIL]" + exitcode=1 +else + echo "[PASS]" +fi + exit $exitcode |