summaryrefslogtreecommitdiffstats
path: root/kernel/rcu/rcu_segcblist.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.ibm.com>2019-04-13 00:58:34 +0200
committerPaul E. McKenney <paulmck@linux.ibm.com>2019-08-13 23:35:49 +0200
commitce5215c1342c6c89b3c3c45fea82cddf0b013787 (patch)
tree06943157837341c47eadb469cd225f5966f4c9ed /kernel/rcu/rcu_segcblist.c
parentrcu/nocb: Use separate flag to indicate disabled ->cblist (diff)
downloadlinux-ce5215c1342c6c89b3c3c45fea82cddf0b013787.tar.xz
linux-ce5215c1342c6c89b3c3c45fea82cddf0b013787.zip
rcu/nocb: Use separate flag to indicate offloaded ->cblist
RCU callback processing currently uses rcu_is_nocb_cpu() to determine whether or not the current CPU's callbacks are to be offloaded. This works, but it is not so good for cache locality. Plus use of ->cblist for offloaded callbacks will greatly increase the frequency of these checks. This commit therefore adds a ->offloaded flag to the rcu_segcblist structure to provide a more flexible and cache-friendly means of checking for callback offloading. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Diffstat (limited to 'kernel/rcu/rcu_segcblist.c')
-rw-r--r--kernel/rcu/rcu_segcblist.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/rcu/rcu_segcblist.c b/kernel/rcu/rcu_segcblist.c
index b305dcac34c9..700779f4c0cb 100644
--- a/kernel/rcu/rcu_segcblist.c
+++ b/kernel/rcu/rcu_segcblist.c
@@ -74,6 +74,18 @@ void rcu_segcblist_disable(struct rcu_segcblist *rsclp)
}
/*
+ * Mark the specified rcu_segcblist structure as offloaded. This
+ * structure must be empty.
+ */
+void rcu_segcblist_offload(struct rcu_segcblist *rsclp)
+{
+ WARN_ON_ONCE(!rcu_segcblist_empty(rsclp));
+ WARN_ON_ONCE(rcu_segcblist_n_cbs(rsclp));
+ WARN_ON_ONCE(rcu_segcblist_n_lazy_cbs(rsclp));
+ rsclp->offloaded = 1;
+}
+
+/*
* Does the specified rcu_segcblist structure contain callbacks that
* are ready to be invoked?
*/