Skip to content

Commit 5dc7886

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 <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 6558b91 commit 5dc7886

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kernel/rcu/srcutree.c

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

11561156
check_init_srcu_struct(ssp);
1157+
/*
1158+
* While starting a new grace period, make sure we are in an
1159+
* SRCU read-side critical section so that the grace-period
1160+
* sequence number cannot wrap around in the meantime.
1161+
*/
11571162
idx = __srcu_read_lock_nmisafe(ssp, false);
11581163
ss_state = smp_load_acquire(&ssp->srcu_size_state);
11591164
if (ss_state < SRCU_SIZE_WAIT_CALL)

0 commit comments

Comments
 (0)