summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/rcutorture
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2021-03-18 14:00:59 -0700
committerPaul E. McKenney <paulmck@kernel.org>2021-05-10 16:05:06 -0700
commitb09751d752fb0e8dce4062254da9f813dcb00de5 (patch)
tree88bd489354e912afb9c016e8b755697c5bfff715 /tools/testing/selftests/rcutorture
parentf254a0b52787d108879cc8761ee4f6ce33698029 (diff)
torture: Make the build machine control N in "make -jN"
Given remote rcutorture runs, it is quite possible that the build system will have fewer CPUs than the system(s) running the actual test scenarios. In such cases, using the number of CPUs on the test systems can overload the build system, slowing down the build or, worse, OOMing the build system. This commit therefore uses the build system's CPU count to set N in "make -jN", and by tradition sets "N" to double the CPU count. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/testing/selftests/rcutorture')
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-build.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
index 115e1822b26f..55f4fc102624 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
@@ -40,8 +40,10 @@ if test $retval -gt 1
then
exit 2
fi
-ncpus=`cpus2use.sh`
-make -j$ncpus $TORTURE_KMAKE_ARG > $resdir/Make.out 2>&1
+
+# Tell "make" to use double the number of real CPUs on the build system.
+ncpus="`lscpu | grep '^CPU(' | awk '{ print $2 }'`"
+make -j$((2 * ncpus)) $TORTURE_KMAKE_ARG > $resdir/Make.out 2>&1
retval=$?
if test $retval -ne 0 || grep "rcu[^/]*": < $resdir/Make.out | egrep -q "Stop|Error|error:|warning:" || egrep -q "Stop|Error|error:" < $resdir/Make.out
then