Skip to content

Commit 3aea745

Browse files
paulmckrcuNeeraj Upadhyay (AMD)
authored andcommitted
srcu: Expedite SRCU-fast grace periods
Currently, SRCU-fast grace periods use synchronize_rcu() to provide the needed ordering with readers, even given an expedited SRCU-fast grace period, which isn't all that expedited. This commit therefore instead uses synchronize_rcu_expedited() if there is an expedited SRCU-fast grace period in flight. Of course, given an non-expedited SRCU-fast grace period blocked in synchronize_rcu(), a later request for an expedited SRCU-fast grace period will wait for that synchronize_rcu() to return before switching to use of synchronize_rcu_expedited(). If this turns out to be a real problem for a production workload, we can increase the complexity (but likely also degrade the energy efficiency) to speed things up further. Signed-off-by: Paul E. McKenney <[email protected]> Cc: Andrii Nakryiko <[email protected]> Cc: Alexei Starovoitov <[email protected]> Signed-off-by: Neeraj Upadhyay (AMD) <[email protected]>
1 parent 941ab0b commit 3aea745

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/rcu/srcutree.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,8 @@ static bool srcu_readers_active_idx_check(struct srcu_struct *ssp, int idx)
502502
*/
503503
if (!did_gp)
504504
smp_mb(); /* A */
505+
else if (srcu_gp_is_expedited(ssp))
506+
synchronize_rcu_expedited(); /* X */
505507
else
506508
synchronize_rcu(); /* X */
507509

0 commit comments

Comments
 (0)