Skip to content

Commit ae3c070

Browse files
Frederic Weisbeckerpaulmckrcu
authored andcommitted
srcu: Explain the reason behind the read side critical section on GP start
Tell about the need to protect against concurrent updaters who may overflow the GP counter behind the current update. Reported-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 6b77bb9 commit ae3c070

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

kernel/rcu/srcutree.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,6 +1158,11 @@ static unsigned long srcu_gp_start_if_needed(struct srcu_struct *ssp,
11581158
int ss_state;
11591159

11601160
check_init_srcu_struct(ssp);
1161+
/*
1162+
* While starting a new grace period, make sure we are in an
1163+
* SRCU read-side critical section so that the grace-period
1164+
* sequence number cannot wrap around in the meantime.
1165+
*/
11611166
idx = __srcu_read_lock_nmisafe(ssp, false);
11621167
ss_state = smp_load_acquire(&ssp->srcu_size_state);
11631168
if (ss_state < SRCU_SIZE_WAIT_CALL)

0 commit comments

Comments
 (0)