summaryrefslogtreecommitdiffstats
path: root/kernel/rcu/rcu_segcblist.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2020-12-18 19:20:34 +0100
committerPaul E. McKenney <paulmck@kernel.org>2021-01-07 01:25:00 +0100
commit341690611f8d488859f42a761f5d7cbac6ba2940 (patch)
treefe5f196075d51c21da1d4f9b00c89cb51fc8c5f9 /kernel/rcu/rcu_segcblist.h
parenttools/rcutorture: Support nocb toggle in TREE01 (diff)
downloadlinux-341690611f8d488859f42a761f5d7cbac6ba2940.tar.xz
linux-341690611f8d488859f42a761f5d7cbac6ba2940.zip
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);