2 # SPDX-License-Identifier: GPL-2.0
4 # Copyright (C) 2018 Uladzislau Rezki (Sony) <urezki@gmail.com>
6 # This is a test script for the kernel test driver to analyse vmalloc
7 # allocator. Therefore it is just a kernel module loader. You can specify
8 # and pass different parameters in order to:
9 # a) analyse performance of vmalloc allocations;
10 # b) stressing and stability check of vmalloc subsystem.
18 # Kselftest framework requirement - SKIP code is 4.
21 check_test_requirements()
24 if [ $uid -ne 0 ]; then
25 echo "$0: Must be run as root"
29 if ! which modprobe > /dev/null 2>&1; then
30 echo "$0: You need modprobe installed"
34 if ! modinfo $DRIVER > /dev/null 2>&1; then
35 echo "$0: You must have the following enabled in your kernel:"
36 echo "CONFIG_TEST_HMM=m"
43 modprobe $DRIVER > /dev/null 2>&1
45 major=$(awk "\$2==\"HMM_DMIRROR\" {print \$1}" /proc/devices)
46 mknod /dev/hmm_dmirror0 c $major 0
47 mknod /dev/hmm_dmirror1 c $major 1
53 modprobe -r $DRIVER > /dev/null 2>&1
54 rm -f /dev/hmm_dmirror?
59 echo "Running smoke test. Note, this test provides basic coverage."
62 $(dirname "${BASH_SOURCE[0]}")/hmm-tests
72 echo "# Shows help message"
73 echo "./${TEST_NAME}.sh"
75 echo "# Smoke testing"
76 echo "./${TEST_NAME}.sh smoke"
86 if [ "$1" = "smoke" ]; then
94 check_test_requirements