linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
	dvhart@linux.intel.com, fweisbec@gmail.com, oleg@redhat.com,
	bobby.prani@gmail.com,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH tip/core/rcu 03/14] torture: Forgive lengthy trace dumps and preemption
Date: Wed, 15 Jun 2016 15:09:32 -0700	[thread overview]
Message-ID: <1466028583-8780-3-git-send-email-paulmck@linux.vnet.ibm.com> (raw)
In-Reply-To: <20160615220924.GA7877@linux.vnet.ibm.com>

This commit avoids killing qemu if a trace dump is making progress
or if console log output is continuing and the console log timestamp
does not exceed the total plus grace period.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 .../selftests/rcutorture/bin/kvm-test-1-run.sh      | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 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 4109f306d855..9b17c5252a2e 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -229,6 +229,7 @@ fi
 if test $commandcompleted -eq 0 -a -n "$qemu_pid"
 then
 	echo Grace period for qemu job at pid $qemu_pid
+	oldline="`tail $resdir/console.log`"
 	while :
 	do
 		kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
@@ -238,13 +239,29 @@ then
 		else
 			break
 		fi
-		if test $kruntime -ge $((seconds + $TORTURE_SHUTDOWN_GRACE))
+		must_continue=no
+		newline="`tail $resdir/console.log`"
+		if test "$newline" != "$oldline" && echo $newline | grep -q ' [0-9]\+us : '
+		then
+			must_continue=yes
+		fi
+		last_ts="`tail $resdir/console.log | grep '^\[ *[0-9]\+\.[0-9]\+]' | tail -1 | sed -e 's/^\[ *//' -e 's/\..*$//'`"
+		if test -z "last_ts"
+		then
+			last_ts=0
+		fi
+		if test "$newline" != "$oldline" -a "$last_ts" -lt $((seconds + $TORTURE_SHUTDOWN_GRACE))
+		then
+			must_continue=yes
+		fi
+		if test $must_continue = no -a $kruntime -ge $((seconds + $TORTURE_SHUTDOWN_GRACE))
 		then
 			echo "!!! PID $qemu_pid hung at $kruntime vs. $seconds seconds" >> $resdir/Warnings 2>&1
 			kill -KILL $qemu_pid
 			break
 		fi
-		sleep 1
+		oldline=$newline
+		sleep 10
 	done
 elif test -z "$qemu_pid"
 then
-- 
2.5.2

  parent reply	other threads:[~2016-06-15 22:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15 22:09 [PATCH tip/core/rcu 0/14] Torture-test changes for 4.8 Paul E. McKenney
2016-06-15 22:09 ` [PATCH tip/core/rcu 01/14] torture: Simplify code, eliminate RCU_PERF_TEST_RUNNABLE Paul E. McKenney
2016-06-15 22:09 ` [PATCH tip/core/rcu 02/14] torture: Remove CONFIG_RCU_TORTURE_TEST_RUNNABLE, simplify code Paul E. McKenney
2016-06-15 22:09 ` Paul E. McKenney [this message]
2016-06-15 22:09 ` [PATCH tip/core/rcu 04/14] torture: Break online and offline functions out of torture_onoff() Paul E. McKenney
2016-06-15 22:09 ` [PATCH tip/core/rcu 05/14] torture: Add starvation events to error summary Paul E. McKenney
2016-06-15 22:09 ` [PATCH tip/core/rcu 06/14] torture: Stop onoff task if there is only one cpu Paul E. McKenney
2016-06-15 22:09 ` [PATCH tip/core/rcu 07/14] rcutorture/doc: Create initrd using dracut Paul E. McKenney
2016-06-15 22:09 ` [PATCH tip/core/rcu 08/14] rcutorture: Use vmlinux as the fallback kernel image Paul E. McKenney
2016-06-15 22:09 ` [PATCH tip/core/rcu 09/14] rcutorture: Make -soundhw a x86 specific option Paul E. McKenney
2016-06-15 22:09 ` [PATCH tip/core/rcu 10/14] rcutorture: Don't specify the cpu type of QEMU on PPC Paul E. McKenney
2016-06-15 22:09 ` [PATCH tip/core/rcu 11/14] rcutorture: Drop "-soundhw pcspkr" from x86 boot arguments Paul E. McKenney
2016-06-15 22:09 ` [PATCH tip/core/rcu 12/14] rcuperf: Don't treat gp_exp mis-setting as a WARN Paul E. McKenney
2016-06-15 22:09 ` [PATCH tip/core/rcu 13/14] torture: Inflict default jitter Paul E. McKenney
2016-06-15 22:09 ` [PATCH tip/core/rcu 14/14] rcutorture: Fix error return code in rcu_perf_init() Paul E. McKenney

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=1466028583-8780-3-git-send-email-paulmck@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=bobby.prani@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=dvhart@linux.intel.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).