diff options
author | Joel Fernandes (Google) <joel@joelfernandes.org> | 2020-11-18 11:15:41 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2021-01-06 16:24:19 -0800 |
commit | b4e6039e8af8c20dfbbdfcaebfcbd7c9d9ffe713 (patch) | |
tree | a739b9f1aef750d312a7b0002a8db189c197477e /kernel/rcu/rcu_segcblist.h | |
parent | 3afe7fa535491ecd0382c3968dc2349602bff8a2 (diff) |
rcu/segcblist: Add debug checks for segment lengths
This commit adds debug checks near the end of rcu_do_batch() that emit
warnings if an empty rcu_segcblist structure has non-zero segment counts,
or, conversely, if a non-empty structure has all-zero segment counts.
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
[ paulmck: Fix queue/segment-length checks. ]
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/rcu/rcu_segcblist.h')
-rw-r--r-- | kernel/rcu/rcu_segcblist.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/rcu/rcu_segcblist.h b/kernel/rcu/rcu_segcblist.h index cd35c9faaf51..18e101de8747 100644 --- a/kernel/rcu/rcu_segcblist.h +++ b/kernel/rcu/rcu_segcblist.h @@ -15,6 +15,9 @@ static inline long rcu_cblist_n_cbs(struct rcu_cblist *rclp) return READ_ONCE(rclp->len); } +/* Return number of callbacks in segmented callback list by summing seglen. */ +long rcu_segcblist_n_segment_cbs(struct rcu_segcblist *rsclp); + void rcu_cblist_init(struct rcu_cblist *rclp); void rcu_cblist_enqueue(struct rcu_cblist *rclp, struct rcu_head *rhp); void rcu_cblist_flush_enqueue(struct rcu_cblist *drclp, |