Skip to content

Commit 25b4da7

Browse files
committed
torture: Allow "CFLIST" to specify default list of scenarios
On a large system, it can be convenient to tell rcutorture to run several instances of the default scenarios. Currently, this requires explicitly listing them, for example, "--configs '2*SRCU-N 2*SRCU-P...'". Although this works, it is rather inconvenient. This commit therefore allows "CFLIST" to be specified to indicate the default list of scenarios called out in the relevant CFLIST file, for example, for RCU, tools/testing/selftests/rcutorture/configs/rcu/CFLIST. In addition, multipliers may be used to run multiple instances of all the scenarios. For example, on a 256-CPU system, "--configs '3*CFLIST'" would run three instances of each scenario concurrently with one CPU left over. Thus "--configs '3*CFLIST TINY01'" would exactly consume all 256 CPUs, which makes rcutorture's jitter feature more effective. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 5155be9 commit 25b4da7

File tree

1 file changed

+13
-6
lines changed
  • tools/testing/selftests/rcutorture/bin

1 file changed

+13
-6
lines changed

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,10 @@ fi
198198

199199
CONFIGFRAG=${KVM}/configs/${TORTURE_SUITE}; export CONFIGFRAG
200200

201+
defaultconfigs="`tr '\012' ' ' < $CONFIGFRAG/CFLIST`"
201202
if test -z "$configs"
202203
then
203-
configs="`cat $CONFIGFRAG/CFLIST`"
204+
configs=$defaultconfigs
204205
fi
205206

206207
if test -z "$resdir"
@@ -209,7 +210,7 @@ then
209210
fi
210211

211212
# Create a file of test-name/#cpus pairs, sorted by decreasing #cpus.
212-
touch $T/cfgcpu
213+
configs_derep=
213214
for CF in $configs
214215
do
215216
case $CF in
@@ -222,15 +223,21 @@ do
222223
CF1=$CF
223224
;;
224225
esac
226+
for ((cur_rep=0;cur_rep<$config_reps;cur_rep++))
227+
do
228+
configs_derep="$configs_derep $CF1"
229+
done
230+
done
231+
touch $T/cfgcpu
232+
configs_derep="`echo $configs_derep | sed -e "s/\<CFLIST\>/$defaultconfigs/g"`"
233+
for CF1 in $configs_derep
234+
do
225235
if test -f "$CONFIGFRAG/$CF1"
226236
then
227237
cpu_count=`configNR_CPUS.sh $CONFIGFRAG/$CF1`
228238
cpu_count=`configfrag_boot_cpus "$TORTURE_BOOTARGS" "$CONFIGFRAG/$CF1" "$cpu_count"`
229239
cpu_count=`configfrag_boot_maxcpus "$TORTURE_BOOTARGS" "$CONFIGFRAG/$CF1" "$cpu_count"`
230-
for ((cur_rep=0;cur_rep<$config_reps;cur_rep++))
231-
do
232-
echo $CF1 $cpu_count >> $T/cfgcpu
233-
done
240+
echo $CF1 $cpu_count >> $T/cfgcpu
234241
else
235242
echo "The --configs file $CF1 does not exist, terminating."
236243
exit 1

0 commit comments

Comments
 (0)