summaryrefslogtreecommitdiff
path: root/kernel/rcu/rcu_segcblist.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2020-12-18 10:20:34 -0800
committerPaul E. McKenney <paulmck@kernel.org>2021-01-06 16:25:00 -0800
commit341690611f8d488859f42a761f5d7cbac6ba2940 (patch)
treefe5f196075d51c21da1d4f9b00c89cb51fc8c5f9 /kernel/rcu/rcu_segcblist.h
parent70e8088b97211177225acf499247b3741cc8a229 (diff)
rcu/nocb: Add grace period and task state to show_rcu_nocb_state() output
This commit improves debuggability by indicating which grace period each batch of nocb callbacks is waiting on and by showing the task state and last CPU for reach nocb kthread. [ paulmck: Handle !SMP CB offloading per kernel test robot feedback. ] Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/rcu/rcu_segcblist.h')
-rw-r--r--kernel/rcu/rcu_segcblist.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/rcu/rcu_segcblist.h b/kernel/rcu/rcu_segcblist.h
index afad6fc6311c..311060279f1a 100644
--- a/kernel/rcu/rcu_segcblist.h
+++ b/kernel/rcu/rcu_segcblist.h
@@ -117,6 +117,17 @@ static inline bool rcu_segcblist_restempty(struct rcu_segcblist *rsclp, int seg)
return !READ_ONCE(*READ_ONCE(rsclp->tails[seg]));
}
+/*
+ * Is the specified segment of the specified rcu_segcblist structure
+ * empty of callbacks?
+ */
+static inline bool rcu_segcblist_segempty(struct rcu_segcblist *rsclp, int seg)
+{
+ if (seg == RCU_DONE_TAIL)
+ return &rsclp->head == rsclp->tails[RCU_DONE_TAIL];
+ return rsclp->tails[seg - 1] == rsclp->tails[seg];
+}
+
void rcu_segcblist_inc_len(struct rcu_segcblist *rsclp);
void rcu_segcblist_add_len(struct rcu_segcblist *rsclp, long v);
void rcu_segcblist_init(struct rcu_segcblist *rsclp);