Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1695204

[PATCH tip/core/rcu 06/13] rcutorture: Don't wait for kernel when all builds fail

From "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH tip/core/rcu 06/13] rcutorture: Don't wait for kernel when all builds fail
Date 2017-07-25 00:30 +0200
Message-ID <u6U1t-2LB-33@gated-at.bofh.it> (permalink)
References <u6U1r-2LB-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Currently, rcutorture groups runs in batches, building each scenario in
a given batch, then invoking qemu to run all the kernels in the batch.
Of course, if a given scenario's kernel fails to build, there is no qemu
run for that scenario.  And if all of the kernels in a given batch fail
to build, there are no runs, and rcutorture immediately starts on the
next batch.

But not if --jitter has been specified, which it is by default.  In this
case, the jitter scripts are started unconditionally, and rcutorture
waits for them to complete, even though there are no kernels to run.

This commit therefore checks for this situation, and refuses to start
jitter unless at least one of the kernels in the batch built successfully.
This saves substantial time when all scenarios' kernels fail to build,
particularly if a long --duration was specified.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 .../selftests/rcutorture/bin/kvm-test-1-run.sh     |  4 ++++
 tools/testing/selftests/rcutorture/bin/kvm.sh      | 25 ++++++++++++++++------
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
index 2a3f87a8c87d..0af36a721b9c 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -96,6 +96,8 @@ then
 	KERNEL=$base_resdir/${BOOT_IMAGE##*/} # use the last component of ${BOOT_IMAGE}
 	ln -s $base_resdir/Make*.out $resdir  # for kvm-recheck.sh
 	ln -s $base_resdir/.config $resdir  # for kvm-recheck.sh
+	# Arch-independent indicator
+	touch $resdir/builtkernel
 elif kvm-build.sh $T/Kc2 $builddir
 then
 	# Had to build a kernel for this test.
@@ -108,6 +110,8 @@ then
 	then
 		cp $builddir/$BOOT_IMAGE $resdir
 		KERNEL=$resdir/${BOOT_IMAGE##*/}
+		# Arch-independent indicator
+		touch $resdir/builtkernel
 	else
 		echo No identifiable boot image, not running KVM, see $resdir.
 		echo Do the torture scripts know about your architecture?
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 690cb91f0295..cdb32aa79366 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -332,6 +332,7 @@ function dump(first, pastlast, batchnum)
 {
 	print "echo ----Start batch " batchnum ": `date`";
 	print "echo ----Start batch " batchnum ": `date` >> " rd "/log";
+	print "needqemurun="
 	jn=1
 	for (j = first; j < pastlast; j++) {
 		builddir=KVM "/b" jn
@@ -367,10 +368,11 @@ function dump(first, pastlast, batchnum)
 	for (j = 1; j < jn; j++) {
 		builddir=KVM "/b" j
 		print "rm -f " builddir ".ready"
-		print "if test -z \"$TORTURE_BUILDONLY\""
+		print "if test -f \"" rd cfr[j] "/builtkernel\""
 		print "then"
-		print "\techo ----", cfr[j], cpusr[j] ovf ": Starting kernel. `date`";
-		print "\techo ----", cfr[j], cpusr[j] ovf ": Starting kernel. `date` >> " rd "/log";
+		print "\techo ----", cfr[j], cpusr[j] ovf ": Kernel present. `date`";
+		print "\techo ----", cfr[j], cpusr[j] ovf ": Kernel present. `date` >> " rd "/log";
+		print "\tneedqemurun=1"
 		print "fi"
 	}
 	njitter = 0;
@@ -385,13 +387,22 @@ function dump(first, pastlast, batchnum)
 		njitter = 0;
 		print "echo Build-only run, so suppressing jitter >> " rd "/log"
 	}
-	for (j = 0; j < njitter; j++)
-		print "jitter.sh " j " " dur " " ja[2] " " ja[3] "&"
-	print "wait"
-	print "if test -z \"$TORTURE_BUILDONLY\""
+	if (TORTURE_BUILDONLY) {
+		print "needqemurun="
+	}
+	print "if test -n \"$needqemurun\""
 	print "then"
+	print "\techo ---- Starting kernels. `date`";
+	print "\techo ---- Starting kernels. `date` >> " rd "/log";
+	for (j = 0; j < njitter; j++)
+		print "\tjitter.sh " j " " dur " " ja[2] " " ja[3] "&"
+	print "\twait"
 	print "\techo ---- All kernel runs complete. `date`";
 	print "\techo ---- All kernel runs complete. `date` >> " rd "/log";
+	print "else"
+	print "\twait"
+	print "\techo ---- No kernel runs. `date`";
+	print "\techo ---- No kernel runs. `date` >> " rd "/log";
 	print "fi"
 	for (j = 1; j < jn; j++) {
 		builddir=KVM "/b" j
-- 
2.5.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH tip/core/rcu 0/13] Torture-test updates "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200
  [PATCH tip/core/rcu 09/13] rcutorture: Use nr_cpus rather than maxcpus to limit test size "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200
  [PATCH tip/core/rcu 11/13] rcutorture: Eliminate unused ts_rem local from rcu_trace_clock_local() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200
  [PATCH tip/core/rcu 12/13] rcu: Add last-CPU to GP-kthread starvation messages "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200
  [PATCH tip/core/rcu 13/13] rcutorture: Invoke call_rcu() from timer handler "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200
  [PATCH tip/core/rcu 06/13] rcutorture: Don't wait for kernel when all builds fail "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200
  [PATCH tip/core/rcu 05/13] torture: Add --kconfig argument to kvm.sh "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200
  [PATCH tip/core/rcu 07/13] rcutorture: Enable SRCU readers from timer handler "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200
  [PATCH tip/core/rcu 01/13] rcutorture: Move SRCU status printing to SRCU implementations "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200
  [PATCH tip/core/rcu 08/13] rcutorture: Place event-traced strings into trace buffer "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200
  [PATCH tip/core/rcu 02/13] rcutorture: Print SRCU lock/unlock totals "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200

csiph-web