[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-90083998312324599cb2a546020755cdc934de0f@git.kernel.org>
Date: Fri, 19 Apr 2019 03:44:27 -0700
From: tip-bot for Mathieu Desnoyers <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: josh@...htriplett.org, catalin.marinas@....com, joelaf@...gle.com,
paulmck@...ux.vnet.ibm.com, hpa@...or.com, mtk.manpages@...il.com,
tglx@...utronix.de, mathieu.desnoyers@...icios.com, bmaurer@...com,
rostedt@...dmis.org, davejwatson@...com, boqun.feng@...il.com,
pjt@...gle.com, will.deacon@....com, torvalds@...ux-foundation.org,
linux@....linux.org.uk, cl@...ux.com, akpm@...ux-foundation.org,
shuah@...nel.org, linux-kernel@...r.kernel.org, mingo@...nel.org,
luto@...capital.net, peterz@...radead.org
Subject: [tip:core/rseq] rseq/selftests: Adapt number of threads to the
number of detected cpus
Commit-ID: 90083998312324599cb2a546020755cdc934de0f
Gitweb: https://git.kernel.org/tip/90083998312324599cb2a546020755cdc934de0f
Author: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
AuthorDate: Tue, 5 Mar 2019 14:47:55 -0500
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Fri, 19 Apr 2019 12:39:32 +0200
rseq/selftests: Adapt number of threads to the number of detected cpus
On smaller systems, running a test with 200 threads can take a long
time on machines with smaller number of CPUs.
Detect the number of online cpus at test runtime, and multiply that
by 6 to have 6 rseq threads per cpu preempting each other.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Ben Maurer <bmaurer@...com>
Cc: Boqun Feng <boqun.feng@...il.com>
Cc: Catalin Marinas <catalin.marinas@....com>
Cc: Chris Lameter <cl@...ux.com>
Cc: Dave Watson <davejwatson@...com>
Cc: Joel Fernandes <joelaf@...gle.com>
Cc: Josh Triplett <josh@...htriplett.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Michael Kerrisk <mtk.manpages@...il.com>
Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Paul Turner <pjt@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Russell King <linux@....linux.org.uk>
Cc: Shuah Khan <shuah@...nel.org>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Will Deacon <will.deacon@....com>
Cc: linux-api@...r.kernel.org
Cc: linux-kselftest@...r.kernel.org
Link: http://lkml.kernel.org/r/20190305194755.2602-4-mathieu.desnoyers@efficios.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
tools/testing/selftests/rseq/run_param_test.sh | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/rseq/run_param_test.sh b/tools/testing/selftests/rseq/run_param_test.sh
index 3acd6d75ff9f..e426304fd4a0 100755
--- a/tools/testing/selftests/rseq/run_param_test.sh
+++ b/tools/testing/selftests/rseq/run_param_test.sh
@@ -1,6 +1,8 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0+ or MIT
+NR_CPUS=`grep '^processor' /proc/cpuinfo | wc -l`
+
EXTRA_ARGS=${@}
OLDIFS="$IFS"
@@ -28,15 +30,16 @@ IFS="$OLDIFS"
REPS=1000
SLOW_REPS=100
+NR_THREADS=$((6*${NR_CPUS}))
function do_tests()
{
local i=0
while [ "$i" -lt "${#TEST_LIST[@]}" ]; do
echo "Running test ${TEST_NAME[$i]}"
- ./param_test ${TEST_LIST[$i]} -r ${REPS} ${@} ${EXTRA_ARGS} || exit 1
+ ./param_test ${TEST_LIST[$i]} -r ${REPS} -t ${NR_THREADS} ${@} ${EXTRA_ARGS} || exit 1
echo "Running compare-twice test ${TEST_NAME[$i]}"
- ./param_test_compare_twice ${TEST_LIST[$i]} -r ${REPS} ${@} ${EXTRA_ARGS} || exit 1
+ ./param_test_compare_twice ${TEST_LIST[$i]} -r ${REPS} -t ${NR_THREADS} ${@} ${EXTRA_ARGS} || exit 1
let "i++"
done
}
Powered by blists - more mailing lists