rcu: Add READ_ONCE() to rcu_do_batch() access to rcu_resched_ns
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 24 Jun 2020 00:49:40 +0000 (17:49 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 25 Aug 2020 01:36:07 +0000 (18:36 -0700)
commita2b354b9950bb859d8d959f951dda26725b041fb
treea262cadd8ed9ef7492dfd22f02d5bd48db0d7e73
parentb5374b2df0ac1c78895b8eb8d9582a7bdc67257d
rcu: Add READ_ONCE() to rcu_do_batch() access to rcu_resched_ns

Given that sysfs can change the value of rcu_resched_ns 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 at least a millisecond, but no longer than a second.

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