Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rcu: Further comment and explain the state space of GP sequences

The state space of the GP sequence number isn't documented and the
definitions of its special values are scattered. This commit therefore
gathers some common knowledge near the grace-period sequence-number
definitions.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>

authored by

Frederic Weisbecker and committed by
Joel Fernandes (Google)
3636d8d1 fe15c26e

+37
+37
kernel/rcu/rcu.h
··· 14 14 15 15 /* 16 16 * Grace-period counter management. 17 + * 18 + * The two least significant bits contain the control flags. 19 + * The most significant bits contain the grace-period sequence counter. 20 + * 21 + * When both control flags are zero, no grace period is in progress. 22 + * When either bit is non-zero, a grace period has started and is in 23 + * progress. When the grace period completes, the control flags are reset 24 + * to 0 and the grace-period sequence counter is incremented. 25 + * 26 + * However some specific RCU usages make use of custom values. 27 + * 28 + * SRCU special control values: 29 + * 30 + * SRCU_SNP_INIT_SEQ : Invalid/init value set when SRCU node 31 + * is initialized. 32 + * 33 + * SRCU_STATE_IDLE : No SRCU gp is in progress 34 + * 35 + * SRCU_STATE_SCAN1 : State set by rcu_seq_start(). Indicates 36 + * we are scanning the readers on the slot 37 + * defined as inactive (there might well 38 + * be pending readers that will use that 39 + * index, but their number is bounded). 40 + * 41 + * SRCU_STATE_SCAN2 : State set manually via rcu_seq_set_state() 42 + * Indicates we are flipping the readers 43 + * index and then scanning the readers on the 44 + * slot newly designated as inactive (again, 45 + * the number of pending readers that will use 46 + * this inactive index is bounded). 47 + * 48 + * RCU polled GP special control value: 49 + * 50 + * RCU_GET_STATE_COMPLETED : State value indicating an already-completed 51 + * polled GP has completed. This value covers 52 + * both the state and the counter of the 53 + * grace-period sequence number. 17 54 */ 18 55 19 56 #define RCU_SEQ_CTR_SHIFT 2