rcu: Make rcu_report_exp_cpu_mult() caller acquire lock
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 25 Oct 2024 18:43:28 +0000 (11:43 -0700)
committerUladzislau Rezki (Sony) <urezki@gmail.com>
Sat, 14 Dec 2024 16:09:59 +0000 (17:09 +0100)
commitd16e32f75f30d5228d9e0a3f6ca77b62c3a4383d
tree7dfc14819c43164973f83aff2d5edf2327e1b193
parent049dfe96baf97228a9e98eaf50a8a7386ec7a483
rcu: Make rcu_report_exp_cpu_mult() caller acquire lock

There is a hard-to-trigger bug in the expedited grace-period computation
whose fix requires that the __sync_rcu_exp_select_node_cpus() function
to check that the grace-period sequence number has not changed before
invoking rcu_report_exp_cpu_mult().  However, this check must be done
while holding the leaf rcu_node structure's ->lock.

This commit therefore prepares for that fix by moving this lock's
acquisition from rcu_report_exp_cpu_mult() to its callers (all two
of them).

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
kernel/rcu/tree_exp.h