aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/rcutorture/bin/jitter.sh
diff options
context:
space:
mode:
authorJoel Fernandes (Google) <joel@joelfernandes.org>2019-03-26 15:24:10 -0400
committerPaul E. McKenney <paulmck@linux.ibm.com>2019-05-28 09:06:09 -0700
commite0e2147c1a6a722f6b2e359c5132a825ecb8a420 (patch)
tree6a5f5be7e24801c987f006ba7c1b7bd11ac191c2 /tools/testing/selftests/rcutorture/bin/jitter.sh
parentLinux 5.2-rc1 (diff)
downloadlinux-dev-e0e2147c1a6a722f6b2e359c5132a825ecb8a420.tar.xz
linux-dev-e0e2147c1a6a722f6b2e359c5132a825ecb8a420.zip
rcutorture: Select from only online CPUs
The rcutorture jitter.sh script selects a random CPU but does not check if it is offline or online. This leads to taskset errors many times. On my machine, hyper threading is disabled so half the cores are offline causing taskset errors a lot of times. Let us fix this by checking from only the online CPUs on the system. Cc: rcu@vger.kernel.org Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Diffstat (limited to '')
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/jitter.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/jitter.sh b/tools/testing/selftests/rcutorture/bin/jitter.sh
index 435b60933985..81c6e6ab5d83 100755
--- a/tools/testing/selftests/rcutorture/bin/jitter.sh
+++ b/tools/testing/selftests/rcutorture/bin/jitter.sh
@@ -34,10 +34,11 @@ do
exit 0;
fi
- # Set affinity to randomly selected CPU
- cpus=`ls /sys/devices/system/cpu/*/online |
+ # 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*$'`
+
cpumask=`awk -v cpus="$cpus" -v me=$me -v n=$n 'BEGIN {
srand(n + me + systime());
ncpus = split(cpus, ca);