aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2021-02-10 13:25:58 -0800
committerPaul E. McKenney <paulmck@kernel.org>2021-03-08 14:21:41 -0800
commit8126c57f00cea3502a017b7c76df1fac58f89e88 (patch)
treec81e5682d92d418dff541a4d5d8ea20185a1224c
parentrcu: Make rcu_read_unlock_special() expedite strict grace periods (diff)
downloadlinux-dev-8126c57f00cea3502a017b7c76df1fac58f89e88.tar.xz
linux-dev-8126c57f00cea3502a017b7c76df1fac58f89e88.zip
torture: Make jitter.sh handle large systems
The current jitter.sh script expects cpumask bits to fit into whatever the awk interpreter uses for an integer, which clearly does not hold for even medium-sized systems these days. This means that on a large system, only the first 32 or 64 CPUs (depending) are subjected to jitter.sh CPU-time perturbations. This commit therefore computes a given CPU's cpumask using text manipulation rather than arithmetic shifts. Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/jitter.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/jitter.sh b/tools/testing/selftests/rcutorture/bin/jitter.sh
index 188b864bc4bf..3a856ec2e92a 100755
--- a/tools/testing/selftests/rcutorture/bin/jitter.sh
+++ b/tools/testing/selftests/rcutorture/bin/jitter.sh
@@ -67,10 +67,10 @@ do
srand(n + me + systime());
ncpus = split(cpus, ca);
curcpu = ca[int(rand() * ncpus + 1)];
- mask = lshift(1, curcpu);
- if (mask + 0 <= 0)
- mask = 1;
- printf("%#x\n", mask);
+ z = "";
+ for (i = 1; 4 * i <= curcpu; i++)
+ z = z "0";
+ print "0x" 2 ^ (curcpu % 4) z;
}' < /dev/null`
n=$(($n+1))
if ! taskset -p $cpumask $$ > /dev/null 2>&1