Commit 11202817 authored by Paul E. McKenney's avatar Paul E. McKenney

torture: Do Kconfig analysis only once per scenario

Currently, if a scenario is repeated as in "--configs '4*TREE01'",
the Kconfig analysis is performed for each occurrance (four times in
this example) and each analysis places the exact same data into the
exact same files.  This is not really an issue in this repetition-four
example, but it can needlessly consume tens of seconds of wallclock time
for something like "--config '128*TINY01'".

This commit therefore does Kconfig analysis only once per set of
repeats of a given scenario, courtesy of the "sort -u" command and an
automatically generated awk script.

While in the area, this commit also wordsmiths a comment.
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent b79b0b67
...@@ -286,7 +286,8 @@ then ...@@ -286,7 +286,8 @@ then
exit 1 exit 1
fi fi
fi fi
for CF1 in $configs_derep echo 'BEGIN {' > $T/cfgcpu.awk
for CF1 in `echo $configs_derep | tr -s ' ' '\012' | sort -u`
do do
if test -f "$CONFIGFRAG/$CF1" if test -f "$CONFIGFRAG/$CF1"
then then
...@@ -299,12 +300,20 @@ do ...@@ -299,12 +300,20 @@ do
fi fi
cpu_count=`configfrag_boot_cpus "$TORTURE_BOOTARGS" "$CONFIGFRAG/$CF1" "$cpu_count"` cpu_count=`configfrag_boot_cpus "$TORTURE_BOOTARGS" "$CONFIGFRAG/$CF1" "$cpu_count"`
cpu_count=`configfrag_boot_maxcpus "$TORTURE_BOOTARGS" "$CONFIGFRAG/$CF1" "$cpu_count"` cpu_count=`configfrag_boot_maxcpus "$TORTURE_BOOTARGS" "$CONFIGFRAG/$CF1" "$cpu_count"`
echo $CF1 $cpu_count >> $T/cfgcpu echo 'scenariocpu["'"$CF1"'"] = '"$cpu_count"';' >> $T/cfgcpu.awk
else else
echo "The --configs file $CF1 does not exist, terminating." echo "The --configs file $CF1 does not exist, terminating."
exit 1 exit 1
fi fi
done done
cat << '___EOF___' >> $T/cfgcpu.awk
}
{
for (i = 1; i <= NF; i++)
print $i, scenariocpu[$i];
}
___EOF___
echo $configs_derep | awk -f $T/cfgcpu.awk > $T/cfgcpu
sort -k2nr $T/cfgcpu -T="$T" > $T/cfgcpu.sort sort -k2nr $T/cfgcpu -T="$T" > $T/cfgcpu.sort
# Use a greedy bin-packing algorithm, sorting the list accordingly. # Use a greedy bin-packing algorithm, sorting the list accordingly.
...@@ -324,11 +333,10 @@ END { ...@@ -324,11 +333,10 @@ END {
batch = 0; batch = 0;
nc = -1; nc = -1;
# Each pass through the following loop creates on test batch # Each pass through the following loop creates on test batch that
# that can be executed concurrently given ncpus. Note that a # can be executed concurrently given ncpus. Note that a given test
# given test that requires more than the available CPUs will run in # that requires more than the available CPUs will run in its own
# their own batch. Such tests just have to make do with what # batch. Such tests just have to make do with what is available.
# is available.
while (nc != ncpus) { while (nc != ncpus) {
batch++; batch++;
nc = ncpus; nc = ncpus;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment