[GIT PULL] RCU Tasks fix for systems with non-power-of-two numbers of CPUs

From: Paul E. McKenney
Date: Fri Jan 28 2022 - 09:32:57 EST


Hello, Linus,

This pull request fixes a brown-paper-bag bug in RCU tasks that
causes things like BPF and ftrace to fail miserably on systems with
non-power-of-two numbers of CPUs.

And yes, I will be adding non-power-of-two scenarios to rcutorture,
in case you were wondering. But that can wait for v5.19.

The following changes since commit e783362eb54cd99b2cac8b3a9aeac942e6f6ac07:

Linux 5.17-rc1 (2022-01-23 10:12:53 +0200)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git tags/rcu-urgent.2022.01.26a

for you to fetch changes up to da123016ca8cb5697366c0b2dd55059b976e67e4:

rcu-tasks: Fix computation of CPU-to-list shift counts (2022-01-26 13:04:05 -0800)

----------------------------------------------------------------
Urgent RCU pull request for v5.17

This pull request fixes a math error added in 7a30871b6a27 ("rcu-tasks:
Introduce ->percpu_enqueue_shift for dynamic queue selection') during the
v5.17 merge window. This commit works correctly only on systems with a
power-of-two number of CPUs, which just so happens to be the kind that
rcutorture always uses by default.

This pull request fixes the math so that things also work on systems
that don't happen to have a power-of-two number of CPUs.

----------------------------------------------------------------
Paul E. McKenney (1):
rcu-tasks: Fix computation of CPU-to-list shift counts

kernel/rcu/tasks.h | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)