aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-04-27 10:57:36 -0400
committerIngo Molnar <mingo@kernel.org>2016-04-27 10:57:36 -0400
commit41ed943d855c3fa2bf6fecc33250b294bd568b7a (patch)
treeba29dd5031cc0c61ae9bd0b9c171192040214587 /tools
parentf28f20da704d399fb1e4d8838ffd697a357d9cc8 (diff)
parentdcd36d01fb3f99d1d5df01714f6ccbe3fbbaf81f (diff)
Merge branch 'for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into core/rcu
Pull RCU updates from Paul E. McKenney: * Documentation updates, including fixes to the design-level requirements documentation and a fixed version of the design-level data-structure documentation. These fixes include removing cartoons and getting rid of the html/htmlx duplication. * Further improvements to the new-age expedited grace periods. * Miscellaneous fixes. * Torture-test changes, including a new rcuperf module for measuring RCU grace-period performance and scalability, which is useful for the expedited-grace-period changes. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/jitter.sh90
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh121
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh96
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck.sh5
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh59
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm.sh24
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcu/TREE042
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcu/TREE04.boot2
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcuperf/CFLIST1
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcuperf/CFcommon2
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcuperf/TREE20
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcuperf/TREE5423
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh52
13 files changed, 476 insertions, 21 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/jitter.sh b/tools/testing/selftests/rcutorture/bin/jitter.sh
new file mode 100755
index 000000000000..3633828375e3
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/jitter.sh
@@ -0,0 +1,90 @@
1#!/bin/bash
2#
3# Alternate sleeping and spinning on randomly selected CPUs. The purpose
4# of this script is to inflict random OS jitter on a concurrently running
5# test.
6#
7# Usage: jitter.sh me duration [ sleepmax [ spinmax ] ]
8#
9# me: Random-number-generator seed salt.
10# duration: Time to run in seconds.
11# sleepmax: Maximum microseconds to sleep, defaults to one second.
12# spinmax: Maximum microseconds to spin, defaults to one millisecond.
13#
14# This program is free software; you can redistribute it and/or modify
15# it under the terms of the GNU General Public License as published by
16# the Free Software Foundation; either version 2 of the License, or
17# (at your option) any later version.
18#
19# This program is distributed in the hope that it will be useful,
20# but WITHOUT ANY WARRANTY; without even the implied warranty of
21# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22# GNU General Public License for more details.
23#
24# You should have received a copy of the GNU General Public License
25# along with this program; if not, you can access it online at
26# http://www.gnu.org/licenses/gpl-2.0.html.
27#
28# Copyright (C) IBM Corporation, 2016
29#
30# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
31
32me=$(($1 * 1000))
33duration=$2
34sleepmax=${3-1000000}
35spinmax=${4-1000}
36
37n=1
38
39starttime=`awk 'BEGIN { print systime(); }' < /dev/null`
40
41while :
42do
43 # Check for done.
44 t=`awk -v s=$starttime 'BEGIN { print systime() - s; }' < /dev/null`
45 if test "$t" -gt "$duration"
46 then
47 exit 0;
48 fi
49
50 # Set affinity to randomly selected CPU
51 cpus=`ls /sys/devices/system/cpu/*/online |
52 sed -e 's,/[^/]*$,,' -e 's/^[^0-9]*//' |
53 grep -v '^0*$'`
54 cpumask=`awk -v cpus="$cpus" -v me=$me -v n=$n 'BEGIN {
55 srand(n + me + systime());
56 ncpus = split(cpus, ca);
57 curcpu = ca[int(rand() * ncpus + 1)];
58 mask = lshift(1, curcpu);
59 if (mask + 0 <= 0)
60 mask = 1;
61 printf("%#x\n", mask);
62 }' < /dev/null`
63 n=$(($n+1))
64 if ! taskset -p $cpumask $$ > /dev/null 2>&1
65 then
66 echo taskset failure: '"taskset -p ' $cpumask $$ '"'
67 exit 1
68 fi
69
70 # Sleep a random duration
71 sleeptime=`awk -v me=$me -v n=$n -v sleepmax=$sleepmax 'BEGIN {
72 srand(n + me + systime());
73 printf("%06d", int(rand() * sleepmax));
74 }' < /dev/null`
75 n=$(($n+1))
76 sleep .$sleeptime
77
78 # Spin a random duration
79 limit=`awk -v me=$me -v n=$n -v spinmax=$spinmax 'BEGIN {
80 srand(n + me + systime());
81 printf("%06d", int(rand() * spinmax));
82 }' < /dev/null`
83 n=$(($n+1))
84 for i in {1..$limit}
85 do
86 echo > /dev/null
87 done
88done
89
90exit 1
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh
new file mode 100755
index 000000000000..f79b0e9e84fc
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh
@@ -0,0 +1,121 @@
1#!/bin/bash
2#
3# Analyze a given results directory for rcuperf performance measurements,
4# looking for ftrace data. Exits with 0 if data was found, analyzed, and
5# printed. Intended to be invoked from kvm-recheck-rcuperf.sh after
6# argument checking.
7#
8# Usage: kvm-recheck-rcuperf-ftrace.sh resdir
9#
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2 of the License, or
13# (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program; if not, you can access it online at
22# http://www.gnu.org/licenses/gpl-2.0.html.
23#
24# Copyright (C) IBM Corporation, 2016
25#
26# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
27
28i="$1"
29. tools/testing/selftests/rcutorture/bin/functions.sh
30
31if test "`grep -c 'rcu_exp_grace_period.*start' < $i/console.log`" -lt 100
32then
33 exit 10
34fi
35
36sed -e 's/^\[[^]]*]//' < $i/console.log |
37grep 'us : rcu_exp_grace_period' |
38sed -e 's/us : / : /' |
39tr -d '\015' |
40awk '
41$8 == "start" {
42 if (starttask != "")
43 nlost++;
44 starttask = $1;
45 starttime = $3;
46 startseq = $7;
47}
48
49$8 == "end" {
50 if (starttask == $1 && startseq == $7) {
51 curgpdur = $3 - starttime;
52 gptimes[++n] = curgpdur;
53 gptaskcnt[starttask]++;
54 sum += curgpdur;
55 if (curgpdur > 1000)
56 print "Long GP " starttime "us to " $3 "us (" curgpdur "us)";
57 starttask = "";
58 } else {
59 # Lost a message or some such, reset.
60 starttask = "";
61 nlost++;
62 }
63}
64
65$8 == "done" {
66 piggybackcnt[$1]++;
67}
68
69END {
70 newNR = asort(gptimes);
71 if (newNR <= 0) {
72 print "No ftrace records found???"
73 exit 10;
74 }
75 pct50 = int(newNR * 50 / 100);
76 if (pct50 < 1)
77 pct50 = 1;
78 pct90 = int(newNR * 90 / 100);
79 if (pct90 < 1)
80 pct90 = 1;
81 pct99 = int(newNR * 99 / 100);
82 if (pct99 < 1)
83 pct99 = 1;
84 div = 10 ** int(log(gptimes[pct90]) / log(10) + .5) / 100;
85 print "Histogram bucket size: " div;
86 last = gptimes[1] - 10;
87 count = 0;
88 for (i = 1; i <= newNR; i++) {
89 current = div * int(gptimes[i] / div);
90 if (last == current) {
91 count++;
92 } else {
93 if (count > 0)
94 print last, count;
95 count = 1;
96 last = current;
97 }
98 }
99 if (count > 0)
100 print last, count;
101 print "Distribution of grace periods across tasks:";
102 for (i in gptaskcnt) {
103 print "\t" i, gptaskcnt[i];
104 nbatches += gptaskcnt[i];
105 }
106 ngps = nbatches;
107 print "Distribution of piggybacking across tasks:";
108 for (i in piggybackcnt) {
109 print "\t" i, piggybackcnt[i];
110 ngps += piggybackcnt[i];
111 }
112 print "Average grace-period duration: " sum / newNR " microseconds";
113 print "Minimum grace-period duration: " gptimes[1];
114 print "50th percentile grace-period duration: " gptimes[pct50];
115 print "90th percentile grace-period duration: " gptimes[pct90];
116 print "99th percentile grace-period duration: " gptimes[pct99];
117 print "Maximum grace-period duration: " gptimes[newNR];
118 print "Grace periods: " ngps + 0 " Batches: " nbatches + 0 " Ratio: " ngps / nbatches " Lost: " nlost + 0;
119 print "Computed from ftrace data.";
120}'
121exit 0
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh
new file mode 100755
index 000000000000..8f3121afc716
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh
@@ -0,0 +1,96 @@
1#!/bin/bash
2#
3# Analyze a given results directory for rcuperf performance measurements.
4#
5# Usage: kvm-recheck-rcuperf.sh resdir
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, you can access it online at
19# http://www.gnu.org/licenses/gpl-2.0.html.
20#
21# Copyright (C) IBM Corporation, 2016
22#
23# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
24
25i="$1"
26if test -d $i
27then
28 :
29else
30 echo Unreadable results directory: $i
31 exit 1
32fi
33PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH
34. tools/testing/selftests/rcutorture/bin/functions.sh
35
36if kvm-recheck-rcuperf-ftrace.sh $i
37then
38 # ftrace data was successfully analyzed, call it good!
39 exit 0
40fi
41
42configfile=`echo $i | sed -e 's/^.*\///'`
43
44sed -e 's/^\[[^]]*]//' < $i/console.log |
45awk '
46/-perf: .* gps: .* batches:/ {
47 ngps = $9;
48 nbatches = $11;
49}
50
51/-perf: .*writer-duration/ {
52 gptimes[++n] = $5 / 1000.;
53 sum += $5 / 1000.;
54}
55
56END {
57 newNR = asort(gptimes);
58 if (newNR <= 0) {
59 print "No rcuperf records found???"
60 exit;
61 }
62 pct50 = int(newNR * 50 / 100);
63 if (pct50 < 1)
64 pct50 = 1;
65 pct90 = int(newNR * 90 / 100);
66 if (pct90 < 1)
67 pct90 = 1;
68 pct99 = int(newNR * 99 / 100);
69 if (pct99 < 1)
70 pct99 = 1;
71 div = 10 ** int(log(gptimes[pct90]) / log(10) + .5) / 100;
72 print "Histogram bucket size: " div;
73 last = gptimes[1] - 10;
74 count = 0;
75 for (i = 1; i <= newNR; i++) {
76 current = div * int(gptimes[i] / div);
77 if (last == current) {
78 count++;
79 } else {
80 if (count > 0)
81 print last, count;
82 count = 1;
83 last = current;
84 }
85 }
86 if (count > 0)
87 print last, count;
88 print "Average grace-period duration: " sum / newNR " microseconds";
89 print "Minimum grace-period duration: " gptimes[1];
90 print "50th percentile grace-period duration: " gptimes[pct50];
91 print "90th percentile grace-period duration: " gptimes[pct90];
92 print "99th percentile grace-period duration: " gptimes[pct99];
93 print "Maximum grace-period duration: " gptimes[newNR];
94 print "Grace periods: " ngps + 0 " Batches: " nbatches + 0 " Ratio: " ngps / nbatches;
95 print "Computed from rcuperf printk output.";
96}'
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
index d86bdd6b6cc2..f659346d3358 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
@@ -48,7 +48,10 @@ do
48 cat $i/Make.oldconfig.err 48 cat $i/Make.oldconfig.err
49 fi 49 fi
50 parse-build.sh $i/Make.out $configfile 50 parse-build.sh $i/Make.out $configfile
51 parse-torture.sh $i/console.log $configfile 51 if test "$TORTURE_SUITE" != rcuperf
52 then
53 parse-torture.sh $i/console.log $configfile
54 fi
52 parse-console.sh $i/console.log $configfile 55 parse-console.sh $i/console.log $configfile
53 if test -r $i/Warnings 56 if test -r $i/Warnings
54 then 57 then
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 0f80eefb0bfd..4109f306d855 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -6,7 +6,7 @@
6# Execute this in the source tree. Do not run it as a background task 6# Execute this in the source tree. Do not run it as a background task
7# because qemu does not seem to like that much. 7# because qemu does not seem to like that much.
8# 8#
9# Usage: kvm-test-1-run.sh config builddir resdir minutes qemu-args boot_args 9# Usage: kvm-test-1-run.sh config builddir resdir seconds qemu-args boot_args
10# 10#
11# qemu-args defaults to "-enable-kvm -soundhw pcspk -nographic", along with 11# qemu-args defaults to "-enable-kvm -soundhw pcspk -nographic", along with
12# arguments specifying the number of CPUs and other 12# arguments specifying the number of CPUs and other
@@ -91,25 +91,33 @@ fi
91# CONFIG_PCMCIA=n 91# CONFIG_PCMCIA=n
92# CONFIG_CARDBUS=n 92# CONFIG_CARDBUS=n
93# CONFIG_YENTA=n 93# CONFIG_YENTA=n
94if kvm-build.sh $config_template $builddir $T 94base_resdir=`echo $resdir | sed -e 's/\.[0-9]\+$//'`
95if test "$base_resdir" != "$resdir" -a -f $base_resdir/bzImage -a -f $base_resdir/vmlinux
95then 96then
97 # Rerunning previous test, so use that test's kernel.
98 QEMU="`identify_qemu $base_resdir/vmlinux`"
99 KERNEL=$base_resdir/bzImage
100 ln -s $base_resdir/Make*.out $resdir # for kvm-recheck.sh
101 ln -s $base_resdir/.config $resdir # for kvm-recheck.sh
102elif kvm-build.sh $config_template $builddir $T
103then
104 # Had to build a kernel for this test.
96 QEMU="`identify_qemu $builddir/vmlinux`" 105 QEMU="`identify_qemu $builddir/vmlinux`"
97 BOOT_IMAGE="`identify_boot_image $QEMU`" 106 BOOT_IMAGE="`identify_boot_image $QEMU`"
98 cp $builddir/Make*.out $resdir 107 cp $builddir/Make*.out $resdir
108 cp $builddir/vmlinux $resdir
99 cp $builddir/.config $resdir 109 cp $builddir/.config $resdir
100 if test -n "$BOOT_IMAGE" 110 if test -n "$BOOT_IMAGE"
101 then 111 then
102 cp $builddir/$BOOT_IMAGE $resdir 112 cp $builddir/$BOOT_IMAGE $resdir
113 KERNEL=$resdir/bzImage
103 else 114 else
104 echo No identifiable boot image, not running KVM, see $resdir. 115 echo No identifiable boot image, not running KVM, see $resdir.
105 echo Do the torture scripts know about your architecture? 116 echo Do the torture scripts know about your architecture?
106 fi 117 fi
107 parse-build.sh $resdir/Make.out $title 118 parse-build.sh $resdir/Make.out $title
108 if test -f $builddir.wait
109 then
110 mv $builddir.wait $builddir.ready
111 fi
112else 119else
120 # Build failed.
113 cp $builddir/Make*.out $resdir 121 cp $builddir/Make*.out $resdir
114 cp $builddir/.config $resdir || : 122 cp $builddir/.config $resdir || :
115 echo Build failed, not running KVM, see $resdir. 123 echo Build failed, not running KVM, see $resdir.
@@ -119,12 +127,15 @@ else
119 fi 127 fi
120 exit 1 128 exit 1
121fi 129fi
130if test -f $builddir.wait
131then
132 mv $builddir.wait $builddir.ready
133fi
122while test -f $builddir.ready 134while test -f $builddir.ready
123do 135do
124 sleep 1 136 sleep 1
125done 137done
126minutes=$4 138seconds=$4
127seconds=$(($minutes * 60))
128qemu_args=$5 139qemu_args=$5
129boot_args=$6 140boot_args=$6
130 141
@@ -167,15 +178,26 @@ then
167 exit 0 178 exit 0
168fi 179fi
169echo "NOTE: $QEMU either did not run or was interactive" > $resdir/console.log 180echo "NOTE: $QEMU either did not run or was interactive" > $resdir/console.log
170echo $QEMU $qemu_args -m 512 -kernel $resdir/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd 181echo $QEMU $qemu_args -m 512 -kernel $KERNEL -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
171( $QEMU $qemu_args -m 512 -kernel $resdir/bzImage -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval ) & 182( $QEMU $qemu_args -m 512 -kernel $KERNEL -append "$qemu_append $boot_args"& echo $! > $resdir/qemu_pid; wait `cat $resdir/qemu_pid`; echo $? > $resdir/qemu-retval ) &
172qemu_pid=$!
173commandcompleted=0 183commandcompleted=0
174echo Monitoring qemu job at pid $qemu_pid 184sleep 10 # Give qemu's pid a chance to reach the file
185if test -s "$resdir/qemu_pid"
186then
187 qemu_pid=`cat "$resdir/qemu_pid"`
188 echo Monitoring qemu job at pid $qemu_pid
189else
190 qemu_pid=""
191 echo Monitoring qemu job at yet-as-unknown pid
192fi
175while : 193while :
176do 194do
195 if test -z "$qemu_pid" -a -s "$resdir/qemu_pid"
196 then
197 qemu_pid=`cat "$resdir/qemu_pid"`
198 fi
177 kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null` 199 kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
178 if kill -0 $qemu_pid > /dev/null 2>&1 200 if test -z "$qemu_pid" || kill -0 "$qemu_pid" > /dev/null 2>&1
179 then 201 then
180 if test $kruntime -ge $seconds 202 if test $kruntime -ge $seconds
181 then 203 then
@@ -195,12 +217,16 @@ do
195 ps -fp $killpid >> $resdir/Warnings 2>&1 217 ps -fp $killpid >> $resdir/Warnings 2>&1
196 fi 218 fi
197 else 219 else
198 echo ' ---' `date`: Kernel done 220 echo ' ---' `date`: "Kernel done"
199 fi 221 fi
200 break 222 break
201 fi 223 fi
202done 224done
203if test $commandcompleted -eq 0 225if test -z "$qemu_pid" -a -s "$resdir/qemu_pid"
226then
227 qemu_pid=`cat "$resdir/qemu_pid"`
228fi
229if test $commandcompleted -eq 0 -a -n "$qemu_pid"
204then 230then
205 echo Grace period for qemu job at pid $qemu_pid 231 echo Grace period for qemu job at pid $qemu_pid
206 while : 232 while :
@@ -220,6 +246,9 @@ then
220 fi 246 fi
221 sleep 1 247 sleep 1
222 done 248 done
249elif test -z "$qemu_pid"
250then
251 echo Unknown PID, cannot kill qemu command
223fi 252fi
224 253
225parse-torture.sh $resdir/console.log $title 254parse-torture.sh $resdir/console.log $title
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 4a431767f77a..0d598145873e 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -34,7 +34,7 @@ T=/tmp/kvm.sh.$$
34trap 'rm -rf $T' 0 34trap 'rm -rf $T' 0
35mkdir $T 35mkdir $T
36 36
37dur=30 37dur=$((30*60))
38dryrun="" 38dryrun=""
39KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM 39KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
40PATH=${KVM}/bin:$PATH; export PATH 40PATH=${KVM}/bin:$PATH; export PATH
@@ -48,6 +48,7 @@ resdir=""
48configs="" 48configs=""
49cpus=0 49cpus=0
50ds=`date +%Y.%m.%d-%H:%M:%S` 50ds=`date +%Y.%m.%d-%H:%M:%S`
51jitter=0
51 52
52. functions.sh 53. functions.sh
53 54
@@ -63,6 +64,7 @@ usage () {
63 echo " --dryrun sched|script" 64 echo " --dryrun sched|script"
64 echo " --duration minutes" 65 echo " --duration minutes"
65 echo " --interactive" 66 echo " --interactive"
67 echo " --jitter N [ maxsleep (us) [ maxspin (us) ] ]"
66 echo " --kmake-arg kernel-make-arguments" 68 echo " --kmake-arg kernel-make-arguments"
67 echo " --mac nn:nn:nn:nn:nn:nn" 69 echo " --mac nn:nn:nn:nn:nn:nn"
68 echo " --no-initrd" 70 echo " --no-initrd"
@@ -116,12 +118,17 @@ do
116 ;; 118 ;;
117 --duration) 119 --duration)
118 checkarg --duration "(minutes)" $# "$2" '^[0-9]*$' '^error' 120 checkarg --duration "(minutes)" $# "$2" '^[0-9]*$' '^error'
119 dur=$2 121 dur=$(($2*60))
120 shift 122 shift
121 ;; 123 ;;
122 --interactive) 124 --interactive)
123 TORTURE_QEMU_INTERACTIVE=1; export TORTURE_QEMU_INTERACTIVE 125 TORTURE_QEMU_INTERACTIVE=1; export TORTURE_QEMU_INTERACTIVE
124 ;; 126 ;;
127 --jitter)
128 checkarg --jitter "(# threads [ sleep [ spin ] ])" $# "$2" '^-\{,1\}[0-9]\+\( \+[0-9]\+\)\{,2\} *$' '^error$'
129 jitter="$2"
130 shift
131 ;;
125 --kmake-arg) 132 --kmake-arg)
126 checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$' 133 checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$'
127 TORTURE_KMAKE_ARG="$2" 134 TORTURE_KMAKE_ARG="$2"
@@ -156,7 +163,7 @@ do
156 shift 163 shift
157 ;; 164 ;;
158 --torture) 165 --torture)
159 checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\)$' '^--' 166 checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\|rcuperf\)$' '^--'
160 TORTURE_SUITE=$2 167 TORTURE_SUITE=$2
161 shift 168 shift
162 ;; 169 ;;
@@ -299,6 +306,7 @@ awk < $T/cfgcpu.pack \
299 -v CONFIGDIR="$CONFIGFRAG/" \ 306 -v CONFIGDIR="$CONFIGFRAG/" \
300 -v KVM="$KVM" \ 307 -v KVM="$KVM" \
301 -v ncpus=$cpus \ 308 -v ncpus=$cpus \
309 -v jitter="$jitter" \
302 -v rd=$resdir/$ds/ \ 310 -v rd=$resdir/$ds/ \
303 -v dur=$dur \ 311 -v dur=$dur \
304 -v TORTURE_QEMU_ARG="$TORTURE_QEMU_ARG" \ 312 -v TORTURE_QEMU_ARG="$TORTURE_QEMU_ARG" \
@@ -359,6 +367,16 @@ function dump(first, pastlast, batchnum)
359 print "\techo ----", cfr[j], cpusr[j] ovf ": Starting kernel. `date` >> " rd "/log"; 367 print "\techo ----", cfr[j], cpusr[j] ovf ": Starting kernel. `date` >> " rd "/log";
360 print "fi" 368 print "fi"
361 } 369 }
370 njitter = 0;
371 split(jitter, ja);
372 if (ja[1] == -1 && ncpus == 0)
373 njitter = 1;
374 else if (ja[1] == -1)
375 njitter = ncpus;
376 else
377 njitter = ja[1];
378 for (j = 0; j < njitter; j++)
379 print "jitter.sh " j " " dur " " ja[2] " " ja[3] "&"
362 print "wait" 380 print "wait"
363 print "if test -z \"$TORTURE_BUILDONLY\"" 381 print "if test -z \"$TORTURE_BUILDONLY\""
364 print "then" 382 print "then"
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE04 b/tools/testing/selftests/rcutorture/configs/rcu/TREE04
index 39a2c6d7d7ec..17cbe098b115 100644
--- a/tools/testing/selftests/rcutorture/configs/rcu/TREE04
+++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE04
@@ -14,7 +14,7 @@ CONFIG_HOTPLUG_CPU=n
14CONFIG_SUSPEND=n 14CONFIG_SUSPEND=n
15CONFIG_HIBERNATION=n 15CONFIG_HIBERNATION=n
16CONFIG_RCU_FANOUT=4 16CONFIG_RCU_FANOUT=4
17CONFIG_RCU_FANOUT_LEAF=4 17CONFIG_RCU_FANOUT_LEAF=3
18CONFIG_RCU_NOCB_CPU=n 18CONFIG_RCU_NOCB_CPU=n
19CONFIG_DEBUG_LOCK_ALLOC=n 19CONFIG_DEBUG_LOCK_ALLOC=n
20CONFIG_DEBUG_OBJECTS_RCU_HEAD=n 20CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE04.boot b/tools/testing/selftests/rcutorture/configs/rcu/TREE04.boot
index 0fc8a3428938..e34c33430447 100644
--- a/tools/testing/selftests/rcutorture/configs/rcu/TREE04.boot
+++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE04.boot
@@ -1 +1 @@
rcutorture.torture_type=rcu_bh rcutorture.torture_type=rcu_bh rcutree.rcu_fanout_leaf=4
diff --git a/tools/testing/selftests/rcutorture/configs/rcuperf/CFLIST b/tools/testing/selftests/rcutorture/configs/rcuperf/CFLIST
new file mode 100644
index 000000000000..c9f56cf20775
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/rcuperf/CFLIST
@@ -0,0 +1 @@
TREE
diff --git a/tools/testing/selftests/rcutorture/configs/rcuperf/CFcommon b/tools/testing/selftests/rcutorture/configs/rcuperf/CFcommon
new file mode 100644
index 000000000000..a09816b8c0f3
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/rcuperf/CFcommon
@@ -0,0 +1,2 @@
1CONFIG_RCU_PERF_TEST=y
2CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/rcuperf/TREE b/tools/testing/selftests/rcutorture/configs/rcuperf/TREE
new file mode 100644
index 000000000000..a312f671a29a
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/rcuperf/TREE
@@ -0,0 +1,20 @@
1CONFIG_SMP=y
2CONFIG_PREEMPT_NONE=n
3CONFIG_PREEMPT_VOLUNTARY=n
4CONFIG_PREEMPT=y
5#CHECK#CONFIG_PREEMPT_RCU=y
6CONFIG_HZ_PERIODIC=n
7CONFIG_NO_HZ_IDLE=y
8CONFIG_NO_HZ_FULL=n
9CONFIG_RCU_FAST_NO_HZ=n
10CONFIG_RCU_TRACE=n
11CONFIG_HOTPLUG_CPU=n
12CONFIG_SUSPEND=n
13CONFIG_HIBERNATION=n
14CONFIG_RCU_NOCB_CPU=n
15CONFIG_DEBUG_LOCK_ALLOC=n
16CONFIG_PROVE_LOCKING=n
17CONFIG_RCU_BOOST=n
18CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
19CONFIG_RCU_EXPERT=y
20CONFIG_RCU_TRACE=y
diff --git a/tools/testing/selftests/rcutorture/configs/rcuperf/TREE54 b/tools/testing/selftests/rcutorture/configs/rcuperf/TREE54
new file mode 100644
index 000000000000..985fb170d13c
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/rcuperf/TREE54
@@ -0,0 +1,23 @@
1CONFIG_SMP=y
2CONFIG_NR_CPUS=54
3CONFIG_PREEMPT_NONE=n
4CONFIG_PREEMPT_VOLUNTARY=n
5CONFIG_PREEMPT=y
6#CHECK#CONFIG_PREEMPT_RCU=y
7CONFIG_HZ_PERIODIC=n
8CONFIG_NO_HZ_IDLE=y
9CONFIG_NO_HZ_FULL=n
10CONFIG_RCU_FAST_NO_HZ=n
11CONFIG_RCU_TRACE=n
12CONFIG_HOTPLUG_CPU=n
13CONFIG_SUSPEND=n
14CONFIG_HIBERNATION=n
15CONFIG_RCU_FANOUT=3
16CONFIG_RCU_FANOUT_LEAF=2
17CONFIG_RCU_NOCB_CPU=n
18CONFIG_DEBUG_LOCK_ALLOC=n
19CONFIG_PROVE_LOCKING=n
20CONFIG_RCU_BOOST=n
21CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
22CONFIG_RCU_EXPERT=y
23CONFIG_RCU_TRACE=y
diff --git a/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh
new file mode 100644
index 000000000000..34f2a1b35ee5
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh
@@ -0,0 +1,52 @@
1#!/bin/bash
2#
3# Torture-suite-dependent shell functions for the rest of the scripts.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, you can access it online at
17# http://www.gnu.org/licenses/gpl-2.0.html.
18#
19# Copyright (C) IBM Corporation, 2015
20#
21# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
22
23# rcuperf_param_nreaders bootparam-string
24#
25# Adds nreaders rcuperf module parameter if not already specified.
26rcuperf_param_nreaders () {
27 if ! echo "$1" | grep -q "rcuperf.nreaders"
28 then
29 echo rcuperf.nreaders=-1
30 fi
31}
32
33# rcuperf_param_nwriters bootparam-string
34#
35# Adds nwriters rcuperf module parameter if not already specified.
36rcuperf_param_nwriters () {
37 if ! echo "$1" | grep -q "rcuperf.nwriters"
38 then
39 echo rcuperf.nwriters=-1
40 fi
41}
42
43# per_version_boot_params bootparam-string config-file seconds
44#
45# Adds per-version torture-module parameters to kernels supporting them.
46per_version_boot_params () {
47 echo $1 `rcuperf_param_nreaders "$1"` \
48 `rcuperf_param_nwriters "$1"` \
49 rcuperf.perf_runnable=1 \
50 rcuperf.shutdown=1 \
51 rcuperf.verbose=1
52}