aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/rcu_segcblist.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.ibm.com>2019-05-13 14:36:11 -0700
committerPaul E. McKenney <paulmck@linux.ibm.com>2019-08-13 14:35:49 -0700
commit76c6927c3ee443e756f2c0c9f992cb04b26c65f2 (patch)
tree68851e7d552137042cfb37a18713d753dbaa3e31 /kernel/rcu/rcu_segcblist.h
parentrcu/nocb: Remove deferred wakeup checks for extended quiescent states (diff)
downloadlinux-dev-76c6927c3ee443e756f2c0c9f992cb04b26c65f2.tar.xz
linux-dev-76c6927c3ee443e756f2c0c9f992cb04b26c65f2.zip
rcu/nocb: Allow lockless use of rcu_segcblist_restempty()
Currently, rcu_segcblist_restempty() assumes that the callback list is not being changed by other CPUs, but upcoming changes will require it to operate locklessly. This commit therefore adds the needed READ_ONCE() calls, along with the WRITE_ONCE() calls when updating the callback list. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Diffstat (limited to 'kernel/rcu/rcu_segcblist.h')
-rw-r--r--kernel/rcu/rcu_segcblist.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/rcu/rcu_segcblist.h b/kernel/rcu/rcu_segcblist.h
index 8f3783391075..f74960f0305c 100644
--- a/kernel/rcu/rcu_segcblist.h
+++ b/kernel/rcu/rcu_segcblist.h
@@ -79,7 +79,7 @@ static inline bool rcu_segcblist_is_offloaded(struct rcu_segcblist *rsclp)
*/
static inline bool rcu_segcblist_restempty(struct rcu_segcblist *rsclp, int seg)
{
- return !*rsclp->tails[seg];
+ return !READ_ONCE(*READ_ONCE(rsclp->tails[seg]));
}
void rcu_segcblist_init(struct rcu_segcblist *rsclp);