]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rcu: Provide rcu_barrier_cb_is_done() to check rcu_barrier() CBs
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 2 Aug 2024 00:34:23 +0000 (17:34 -0700)
committerNeeraj Upadhyay <neeraj.upadhyay@kernel.org>
Wed, 14 Aug 2024 11:19:56 +0000 (16:49 +0530)
This commit provides a rcu_barrier_cb_is_done() function that returns
true if the *rcu_barrier*() callback passed in is done.  This will be
used when printing grace-period debugging information.

Signed-off-by: "Paul E. McKenney" <paulmck@kernel.org>
Signed-off-by: Neeraj Upadhyay <neeraj.upadhyay@kernel.org>
kernel/rcu/rcu.h

index 38238e595a61a45fd263df234e199c722149968b..caaed27e476b2b919a25ed0bf6bd7b87e260940e 100644 (file)
@@ -255,6 +255,11 @@ static inline void debug_rcu_head_callback(struct rcu_head *rhp)
                kmem_dump_obj(rhp);
 }
 
+static inline bool rcu_barrier_cb_is_done(struct rcu_head *rhp)
+{
+       return rhp->next == rhp;
+}
+
 extern int rcu_cpu_stall_suppress_at_boot;
 
 static inline bool rcu_stall_is_suppressed_at_boot(void)