Skip to content

Commit 6387ecb

Browse files
committed
torture: Add a stop-run capability
When bisecting RCU issues, it is often the case that the first error in an unsuccessful run will happen quickly, but that a successful run must go on for some time in order to obtain a sufficiently low false-negative error rate. In many cases, a bisection requires multiple concurrent runs, in which case the first failure in any run indicates failure, pure and simple. In such cases, it would speed things up greatly if the first failure terminated all runs. This commit therefore adds scripting that checks for a file named "STOP" in the top-level results directory, terminating the run when it appears. Note that in-progress builds will continue until completion, but future builds and all runs will be cut short. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 3e93a51 commit 6387ecb

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

tools/testing/selftests/rcutorture/bin/jitter.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ do
4646
exit 0;
4747
fi
4848

49+
# Check for stop request.
50+
if test -f "$TORTURE_STOPFILE"
51+
then
52+
exit 1;
53+
fi
54+
4955
# Set affinity to randomly selected online CPU
5056
if cpus=`grep 1 /sys/devices/system/cpu/*/online 2>&1 |
5157
sed -e 's,/[^/]*$,,' -e 's/^[^0-9]*//'`

tools/testing/selftests/rcutorture/bin/kvm-build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
#
1010
# Authors: Paul E. McKenney <[email protected]>
1111

12+
if test -f "$TORTURE_STOPFILE"
13+
then
14+
echo "kvm-build.sh early exit due to run STOP request"
15+
exit 1
16+
fi
17+
1218
config_template=${1}
1319
if test -z "$config_template" -o ! -f "$config_template" -o ! -r "$config_template"
1420
then

tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ do
182182
kruntime=`gawk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
183183
if test -z "$qemu_pid" || kill -0 "$qemu_pid" > /dev/null 2>&1
184184
then
185-
if test $kruntime -ge $seconds
185+
if test $kruntime -ge $seconds -o -f "$TORTURE_STOPFILE"
186186
then
187187
break;
188188
fi
@@ -211,10 +211,19 @@ then
211211
fi
212212
if test $commandcompleted -eq 0 -a -n "$qemu_pid"
213213
then
214-
echo Grace period for qemu job at pid $qemu_pid
214+
if ! test -f "$TORTURE_STOPFILE"
215+
then
216+
echo Grace period for qemu job at pid $qemu_pid
217+
fi
215218
oldline="`tail $resdir/console.log`"
216219
while :
217220
do
221+
if test -f "$TORTURE_STOPFILE"
222+
then
223+
echo "PID $qemu_pid killed due to run STOP request" >> $resdir/Warnings 2>&1
224+
kill -KILL $qemu_pid
225+
break
226+
fi
218227
kruntime=`gawk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
219228
if kill -0 $qemu_pid > /dev/null 2>&1
220229
then

tools/testing/selftests/rcutorture/bin/kvm.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ then
337337
mkdir -p "$resdir" || :
338338
fi
339339
mkdir $resdir/$ds
340+
TORTURE_RESDIR="$resdir/$ds"; export TORTURE_RESDIR
341+
TORTURE_STOPFILE="$resdir/$ds/STOP"; export TORTURE_STOPFILE
340342
echo Results directory: $resdir/$ds
341343
echo $scriptname $args
342344
touch $resdir/$ds/log

0 commit comments

Comments
 (0)