aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2022-01-26 10:42:58 -0800
committerPaul E. McKenney <paulmck@kernel.org>2022-01-26 13:04:05 -0800
commitda123016ca8cb5697366c0b2dd55059b976e67e4 (patch)
tree2a61028f2084a65fa15022e7f461fd979d938bb8 /tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
parentLinux 5.17-rc1 (diff)
downloadlinux-dev-da123016ca8cb5697366c0b2dd55059b976e67e4.tar.xz
linux-dev-da123016ca8cb5697366c0b2dd55059b976e67e4.zip
rcu-tasks: Fix computation of CPU-to-list shift counts
The ->percpu_enqueue_shift field is used to map from the running CPU number to the index of the corresponding callback list. This mapping can change at runtime in response to varying callback load, resulting in varying levels of contention on the callback-list locks. Unfortunately, the initial value of this field is correct only if the system happens to have a power-of-two number of CPUs, otherwise the callbacks from the high-numbered CPUs can be placed into the callback list indexed by 1 (rather than 0), and those index-1 callbacks will be ignored. This can result in soft lockups and hangs. This commit therefore corrects this mapping, adding one to this shift count as needed for systems having odd numbers of CPUs. Fixes: 7a30871b6a27 ("rcu-tasks: Introduce ->percpu_enqueue_shift for dynamic queue selection") Reported-by: Andrii Nakryiko <andrii.nakryiko@gmail.com> Cc: Reported-by: Martin Lau <kafai@fb.com> Cc: Neeraj Upadhyay <neeraj.iitr10@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh')
0 files changed, 0 insertions, 0 deletions