rcutorture: Default grace period to three minutes, allow override
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 1 Oct 2015 18:41:06 +0000 (11:41 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 6 Dec 2015 01:58:12 +0000 (17:58 -0800)
The default test grace period of two minutes is insufficient in some
cases and excessive in others.  This commit therefore increases the
default to three minutes, but also adds a --shutdown-grace parameter
to allow the default to be overridden.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
tools/testing/selftests/rcutorture/bin/kvm.sh

index 5236e073919d2e508e6073d201fa157670a8688e..d39273dae4642dc3d909b1efd32572f880494a74 100755 (executable)
@@ -38,8 +38,6 @@
 #
 # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
 
-grace=120
-
 T=/tmp/kvm-test-1-run.sh.$$
 trap 'rm -rf $T' 0
 touch $T
@@ -214,7 +212,7 @@ then
                else
                        break
                fi
-               if test $kruntime -ge $((seconds + grace))
+               if test $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
index 013c48239a66b2ce8f11306978744384d786416a..4a431767f77a0215096d3cc5421439a857175783 100755 (executable)
@@ -42,6 +42,7 @@ TORTURE_DEFCONFIG=defconfig
 TORTURE_BOOT_IMAGE=""
 TORTURE_INITRD="$KVM/initrd"; export TORTURE_INITRD
 TORTURE_KMAKE_ARG=""
+TORTURE_SHUTDOWN_GRACE=180
 TORTURE_SUITE=rcu
 resdir=""
 configs=""
@@ -149,6 +150,11 @@ do
                resdir=$2
                shift
                ;;
+       --shutdown-grace)
+               checkarg --shutdown-grace "(seconds)" "$#" "$2" '^[0-9]*$' '^error'
+               TORTURE_SHUTDOWN_GRACE=$2
+               shift
+               ;;
        --torture)
                checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\)$' '^--'
                TORTURE_SUITE=$2
@@ -266,6 +272,7 @@ TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG"; export TORTURE_KMAKE_ARG
 TORTURE_QEMU_CMD="$TORTURE_QEMU_CMD"; export TORTURE_QEMU_CMD
 TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE"; export TORTURE_QEMU_INTERACTIVE
 TORTURE_QEMU_MAC="$TORTURE_QEMU_MAC"; export TORTURE_QEMU_MAC
+TORTURE_SHUTDOWN_GRACE="$TORTURE_SHUTDOWN_GRACE"; export TORTURE_SHUTDOWN_GRACE
 TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
 if ! test -e $resdir
 then