From: "Joel Fernandes (Google)" <joel@joelfernandes.org>
To: linux-kernel@vger.kernel.org,
"Paul E. McKenney" <paulmck@kernel.org>,
Josh Triplett <josh@joshtriplett.org>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Shuah Khan <shuah@kernel.org>
Cc: "Joel Fernandes (Google)" <joel@joelfernandes.org>,
rcu@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: [PATCH RFC 5/5] rcutorture: kvm: Invoke stress-ng building it if necessary
Date: Thu, 23 Jan 2025 20:58:36 -0500 [thread overview]
Message-ID: <20250124015836.732086-6-joel@joelfernandes.org> (raw)
In-Reply-To: <20250124015836.732086-1-joel@joelfernandes.org>
Invoke stress-ng from init using new --stress-ng and optional
--stress-ng-args. Default --stress-ng-args are used if none are
provided. Not passing --stress-ng does not change the behavior of kvm.sh
from before.
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
---
tools/testing/selftests/rcutorture/bin/kvm.sh | 38 +++++++++++++++++--
1 file changed, 34 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 4766c3023fed..d35496247ee6 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -42,13 +42,15 @@ TORTURE_JITTER_STOP=""
TORTURE_KCONFIG_KASAN_ARG=""
TORTURE_KCONFIG_KCSAN_ARG=""
TORTURE_KMAKE_ARG=""
+TORTURE_MOD=rcutorture
TORTURE_NO_AFFINITY=""
TORTURE_QEMU_MEM=512
torture_qemu_mem_default=1
TORTURE_REMOTE=
TORTURE_SHUTDOWN_GRACE=180
+TORTURE_STRESS_NG=
+TORTURE_STRESS_NG_DEFAULT_ARGS="--cpu 1 --cpu-method matrixprod --cpu-ops 1000000 --perf -t 5"
TORTURE_SUITE=rcu
-TORTURE_MOD=rcutorture
TORTURE_TRUST_MAKE=""
debuginfo="CONFIG_DEBUG_INFO_NONE=n CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y"
resdir=""
@@ -90,6 +92,8 @@ usage () {
echo " --remote"
echo " --results absolute-pathname"
echo " --shutdown-grace seconds"
+ echo " --stress-ng"
+ echo " --stress-ng-args \"stress-ng arguments\""
echo " --torture lock|rcu|rcuscale|refscale|scf|X*"
echo " --trust-make"
exit 1
@@ -251,6 +255,14 @@ do
TORTURE_SHUTDOWN_GRACE=$2
shift
;;
+ --stress-ng)
+ TORTURE_STRESS_NG=1
+ ;;
+ --stress-ng-args)
+ checkarg --stress-ng-args "(stress-ng arguments)" "$#" "$2" '.*' '^error'
+ TORTURE_STRESS_NG_DEFAULT_ARGS="$2"
+ shift
+ ;;
--torture)
checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\|rcuscale\|refscale\|scf\|X.*\)$' '^--'
TORTURE_SUITE=$2
@@ -275,9 +287,27 @@ do
shift
done
-if test -z "$dryrun" && test -n "$TORTURE_INITRD" && !tools/testing/selftests/rcutorture/bin/mkinitrd.sh
- echo No initrd and unable to create one, aborting test >&2
- exit 1
+if test -n "$TORTURE_STRESS_NG"
+then
+ if ! "$RCUTORTURE/bin/mkstress-ng.sh"
+ then
+ echo "Failed to build stress-ng, aborting test" >&2
+ exit 1
+ fi
+fi
+
+if test -z "$dryrun" && test -n "$TORTURE_INITRD"
+then
+ stress_args=""
+ if test -n "$TORTURE_STRESS_NG"
+ then
+ stress_args="stress-ng $TORTURE_STRESS_NG_DEFAULT_ARGS"
+ fi
+ if ! "$RCUTORTURE/bin/mkinitrd.sh" $stress_args
+ then
+ echo "No initrd and unable to create one, aborting test" >&2
+ exit 1
+ fi
fi
CONFIGFRAG=${RCUTORTURE}/configs/${TORTURE_SUITE}; export CONFIGFRAG
--
2.34.1
prev parent reply other threads:[~2025-01-24 1:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250124015836.732086-1-joel@joelfernandes.org>
2025-01-24 1:58 ` [PATCH RFC 1/5] rcutorture: kvm: Simplify invocation of mkinitrd.sh Joel Fernandes (Google)
2025-01-24 1:58 ` [PATCH RFC 2/5] rcutorture: Add a stress-ng build script Joel Fernandes (Google)
2025-01-24 1:58 ` [PATCH RFC 3/5] rcutorture: mkinitrd: Allow to run optional commands passed to it Joel Fernandes (Google)
2025-01-24 1:58 ` [PATCH RFC 4/5] rcutorture: mkinitrd: Use previous init.c to check if rebuild needed Joel Fernandes (Google)
2025-01-24 1:58 ` Joel Fernandes (Google) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250124015836.732086-6-joel@joelfernandes.org \
--to=joel@joelfernandes.org \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox