Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vm/test_vmalloc.sh: adapt for updated driver interface

A 'single_cpu_test' parameter is odd and it does not exist anymore.
Instead there was introduced a 'nr_threads' one. If it is not set it
behaves as the former parameter.

That is why update a "stress mode" according to this change specifying
number of workers which are equal to number of CPUs. Also update an
output of help message based on a new interface.

Link: https://lkml.kernel.org/r/20210402202237.20334-3-urezki@gmail.com
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Hillf Danton <hdanton@sina.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Oleksiy Avramchenko <oleksiy.avramchenko@sonymobile.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Uladzislau Rezki (Sony) and committed by
Linus Torvalds
7bc4ca3e 80f47599

+11 -10
+11 -10
tools/testing/selftests/vm/test_vmalloc.sh
··· 11 11 12 12 TEST_NAME="vmalloc" 13 13 DRIVER="test_${TEST_NAME}" 14 + NUM_CPUS=`grep -c ^processor /proc/cpuinfo` 14 15 15 16 # 1 if fails 16 17 exitcode=1 ··· 23 22 # Static templates for performance, stressing and smoke tests. 24 23 # Also it is possible to pass any supported parameters manualy. 25 24 # 26 - PERF_PARAM="single_cpu_test=1 sequential_test_order=1 test_repeat_count=3" 27 - SMOKE_PARAM="single_cpu_test=1 test_loop_count=10000 test_repeat_count=10" 28 - STRESS_PARAM="test_repeat_count=20" 25 + PERF_PARAM="sequential_test_order=1 test_repeat_count=3" 26 + SMOKE_PARAM="test_loop_count=10000 test_repeat_count=10" 27 + STRESS_PARAM="nr_threads=$NUM_CPUS test_repeat_count=20" 29 28 30 29 check_test_requirements() 31 30 { ··· 59 58 60 59 run_stability_check() 61 60 { 62 - echo "Run stability tests. In order to stress vmalloc subsystem we run" 63 - echo "all available test cases on all available CPUs simultaneously." 61 + echo "Run stability tests. In order to stress vmalloc subsystem all" 62 + echo "available test cases are run by NUM_CPUS workers simultaneously." 64 63 echo "It will take time, so be patient." 65 64 66 65 modprobe $DRIVER $STRESS_PARAM > /dev/null 2>&1 ··· 93 92 echo "# Shows help message" 94 93 echo "./${DRIVER}.sh" 95 94 echo 96 - echo "# Runs 1 test(id_1), repeats it 5 times on all online CPUs" 97 - echo "./${DRIVER}.sh run_test_mask=1 test_repeat_count=5" 95 + echo "# Runs 1 test(id_1), repeats it 5 times by NUM_CPUS workers" 96 + echo "./${DRIVER}.sh nr_threads=$NUM_CPUS run_test_mask=1 test_repeat_count=5" 98 97 echo 99 98 echo -n "# Runs 4 tests(id_1|id_2|id_4|id_16) on one CPU with " 100 99 echo "sequential order" 101 - echo -n "./${DRIVER}.sh single_cpu_test=1 sequential_test_order=1 " 100 + echo -n "./${DRIVER}.sh sequential_test_order=1 " 102 101 echo "run_test_mask=23" 103 102 echo 104 - echo -n "# Runs all tests on all online CPUs, shuffled order, repeats " 103 + echo -n "# Runs all tests by NUM_CPUS workers, shuffled order, repeats " 105 104 echo "20 times" 106 - echo "./${DRIVER}.sh test_repeat_count=20" 105 + echo "./${DRIVER}.sh nr_threads=$NUM_CPUS test_repeat_count=20" 107 106 echo 108 107 echo "# Performance analysis" 109 108 echo "./${DRIVER}.sh performance"