All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rcutorture: Select from only online CPUs
@ 2019-03-23  3:46 ` Joel Fernandes (Google)
  0 siblings, 0 replies; 33+ messages in thread
From: joel @ 2019-03-23  3:46 UTC (permalink / raw)


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.

Signed-off-by: Joel Fernandes (Google) <joel at joelfernandes.org>
---
 tools/testing/selftests/rcutorture/bin/jitter.sh | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/rcutorture/bin/jitter.sh b/tools/testing/selftests/rcutorture/bin/jitter.sh
index 3633828375e3..53bf9d99b5cd 100755
--- a/tools/testing/selftests/rcutorture/bin/jitter.sh
+++ b/tools/testing/selftests/rcutorture/bin/jitter.sh
@@ -47,10 +47,19 @@ do
 		exit 0;
 	fi
 
-	# Set affinity to randomly selected CPU
+	# Set affinity to randomly selected online CPU
 	cpus=`ls /sys/devices/system/cpu/*/online |
 		sed -e 's,/[^/]*$,,' -e 's/^[^0-9]*//' |
 		grep -v '^0*$'`
+
+	for c in $cpus; do
+		if [ "$(cat /sys/devices/system/cpu/cpu$c/online)" == "1" ];
+		then
+			cpus_tmp="$cpus_tmp $c"
+		fi
+	done
+	cpus=$cpus_tmp
+
 	cpumask=`awk -v cpus="$cpus" -v me=$me -v n=$n 'BEGIN {
 		srand(n + me + systime());
 		ncpus = split(cpus, ca);
-- 
2.21.0.392.gf8f6787159e-goog

^ permalink raw reply related	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2019-03-26 23:49 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-23  3:46 [PATCH] rcutorture: Select from only online CPUs joel
2019-03-23  3:46 ` Joel Fernandes (Google)
2019-03-23  3:46 ` Joel Fernandes (Google)
2019-03-25 15:01 ` paulmck
2019-03-25 15:01   ` Paul E. McKenney
2019-03-25 15:01   ` Paul E. McKenney
2019-03-25 16:33   ` joel
2019-03-25 16:33     ` Joel Fernandes
2019-03-25 16:33     ` Joel Fernandes
2019-03-25 16:42     ` paulmck
2019-03-25 16:42       ` Paul E. McKenney
2019-03-25 16:42       ` Paul E. McKenney
2019-03-25 22:02       ` joel
2019-03-25 22:02         ` Joel Fernandes
2019-03-25 22:02         ` Joel Fernandes
2019-03-25 22:40       ` joel
2019-03-25 22:40         ` Joel Fernandes
2019-03-25 22:40         ` Joel Fernandes
2019-03-26 16:01         ` paulmck
2019-03-26 16:01           ` Paul E. McKenney
2019-03-26 16:01           ` Paul E. McKenney
2019-03-26 18:35           ` joel
2019-03-26 18:35             ` Joel Fernandes
2019-03-26 18:35             ` Joel Fernandes
2019-03-26 18:40             ` joel
2019-03-26 18:40               ` Joel Fernandes
2019-03-26 18:40               ` Joel Fernandes
2019-03-26 20:46               ` paulmck
2019-03-26 20:46                 ` Paul E. McKenney
2019-03-26 20:46                 ` Paul E. McKenney
2019-03-26 23:48                 ` joel
2019-03-26 23:48                   ` Joel Fernandes
2019-03-26 23:48                   ` Joel Fernandes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.