rcutorture: Add cpu0 to the set of CPUs to add jitter
authorJoel Fernandes (Google) <joel@joelfernandes.org>
Tue, 26 Mar 2019 19:24:11 +0000 (15:24 -0400)
committerPaul E. McKenney <paulmck@linux.ibm.com>
Tue, 28 May 2019 16:06:09 +0000 (09:06 -0700)
jitter.sh currently does not add CPU0 to the list of CPUs for adding of
jitter. Let us add it to this list even when it is not hot-pluggable.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
tools/testing/selftests/rcutorture/bin/jitter.sh

index 81c6e6a..dc49a3b 100755 (executable)
@@ -36,8 +36,12 @@ do
 
        # Set affinity to randomly selected online CPU
        cpus=`grep 1 /sys/devices/system/cpu/*/online |
-               sed -e 's,/[^/]*$,,' -e 's/^[^0-9]*//' |
-               grep -v '^0*$'`
+               sed -e 's,/[^/]*$,,' -e 's/^[^0-9]*//'`
+
+       # Do not leave out poor old cpu0 which may not be hot-pluggable
+       if [ ! -f "/sys/devices/system/cpu/cpu0/online" ]; then
+               cpus="0 $cpus"
+       fi
 
        cpumask=`awk -v cpus="$cpus" -v me=$me -v n=$n 'BEGIN {
                srand(n + me + systime());