lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-03a33ecc26af28ca9535de2b0612c54deafa9728@git.kernel.org>
Date:   Fri, 19 Apr 2019 03:46:00 -0700
From:   tip-bot for Mathieu Desnoyers <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     davejwatson@...com, mingo@...nel.org, cl@...ux.com,
        linux-kernel@...r.kernel.org, linux@....linux.org.uk,
        mathieu.desnoyers@...icios.com, rostedt@...dmis.org,
        joelaf@...gle.com, catalin.marinas@....com, mtk.manpages@...il.com,
        luto@...capital.net, boqun.feng@...il.com, pjt@...gle.com,
        bmaurer@...com, shuah@...nel.org, paulmck@...ux.vnet.ibm.com,
        akpm@...ux-foundation.org, will.deacon@....com,
        torvalds@...ux-foundation.org, tglx@...utronix.de,
        peterz@...radead.org, hpa@...or.com, josh@...htriplett.org
Subject: [tip:core/rseq] rseq/selftests: Adapt number of threads to the
 number of detected CPUs

Commit-ID:  03a33ecc26af28ca9535de2b0612c54deafa9728
Gitweb:     https://git.kernel.org/tip/03a33ecc26af28ca9535de2b0612c54deafa9728
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:42:14 +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

Powered by Openwall GNU/*/Linux Powered by OpenVZ