aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/rcu_segcblist.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.ibm.com>2019-05-13 15:57:50 -0700
committerPaul E. McKenney <paulmck@linux.ibm.com>2019-08-13 14:35:49 -0700
commite6060b41c9955374079926a7612b857a8458ed1f (patch)
tree297581f29d4caec633aa474b3b4dc30f16e5cffe /kernel/rcu/rcu_segcblist.h
parentrcu/nocb: Allow lockless use of rcu_segcblist_restempty() (diff)
downloadlinux-dev-e6060b41c9955374079926a7612b857a8458ed1f.tar.xz
linux-dev-e6060b41c9955374079926a7612b857a8458ed1f.zip
rcu/nocb: Allow lockless use of rcu_segcblist_empty()
Currently, rcu_segcblist_empty() 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() call, along with the WRITE_ONCE() calls when updating the callback list's ->head field. 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 f74960f0305c..d9142b3590a8 100644
--- a/kernel/rcu/rcu_segcblist.h
+++ b/kernel/rcu/rcu_segcblist.h
@@ -36,7 +36,7 @@ struct rcu_head *rcu_cblist_dequeue(struct rcu_cblist *rclp);
*/
static inline bool rcu_segcblist_empty(struct rcu_segcblist *rsclp)
{
- return !rsclp->head;
+ return !READ_ONCE(rsclp->head);
}
/* Return number of callbacks in segmented callback list. */