Skip to content

Commit b3d7315

Browse files
committed
rcu: Reinstate synchronize_rcu_mult()
With the advent and likely usage of synchronize_rcu_rude(), there is again a need to wait on multiple types of RCU grace periods, for example, call_rcu_tasks() and call_rcu_tasks_rude(). This commit therefore reinstates synchronize_rcu_mult() in order to allow these grace periods to be straightforwardly waited on concurrently. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 07e1051 commit b3d7315

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

include/linux/rcupdate_wait.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,23 @@ do { \
3131

3232
#define wait_rcu_gp(...) _wait_rcu_gp(false, __VA_ARGS__)
3333

34+
/**
35+
* synchronize_rcu_mult - Wait concurrently for multiple grace periods
36+
* @...: List of call_rcu() functions for different grace periods to wait on
37+
*
38+
* This macro waits concurrently for multiple types of RCU grace periods.
39+
* For example, synchronize_rcu_mult(call_rcu, call_rcu_tasks) would wait
40+
* on concurrent RCU and RCU-tasks grace periods. Waiting on a given SRCU
41+
* domain requires you to write a wrapper function for that SRCU domain's
42+
* call_srcu() function, with this wrapper supplying the pointer to the
43+
* corresponding srcu_struct.
44+
*
45+
* The first argument tells Tiny RCU's _wait_rcu_gp() not to
46+
* bother waiting for RCU. The reason for this is because anywhere
47+
* synchronize_rcu_mult() can be called is automatically already a full
48+
* grace period.
49+
*/
50+
#define synchronize_rcu_mult(...) \
51+
_wait_rcu_gp(IS_ENABLED(CONFIG_TINY_RCU), __VA_ARGS__)
52+
3453
#endif /* _LINUX_SCHED_RCUPDATE_WAIT_H */

0 commit comments

Comments
 (0)