rcu: Add READ_ONCE() to rcu_do_batch() access to rcu_divisor
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 24 Jun 2020 00:09:27 +0000 (17:09 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 25 Aug 2020 01:36:06 +0000 (18:36 -0700)
commitb5374b2df0ac1c78895b8eb8d9582a7bdc67257d
treefe85aaaab9d7064dbd619c4198537f9a5d727604
parent2130c6b4f610ea65e9df71dfa79ee08f2fc17743
rcu: Add READ_ONCE() to rcu_do_batch() access to rcu_divisor

Given that sysfs can change the value of rcu_divisor at any time, this
commit adds a READ_ONCE to the sole access to that variable.  While in
the area, this commit also adds bounds checking, clamping the value to
a shift that makes sense for a signed long.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c