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

srcu: Add comments for srcu_size_state

The SRCU_SIZE_* names are not self-explanatory, so this commit therefore
adds comments to the definitions.

Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: "Zhang, Qiang1" <qiang1.zhang@intel.com>
To: rcu@vger.kernel.org
Reviewed-by: Paul E. McKenney <paulmck@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

Pingfan Liu and committed by
Joel Fernandes (Google)
e15a1930 3636d8d1

+23 -10
+23 -10
include/linux/srcutree.h
··· 92 92 struct lockdep_map dep_map; 93 93 }; 94 94 95 - /* Values for size state variable (->srcu_size_state). */ 96 - #define SRCU_SIZE_SMALL 0 97 - #define SRCU_SIZE_ALLOC 1 98 - #define SRCU_SIZE_WAIT_BARRIER 2 99 - #define SRCU_SIZE_WAIT_CALL 3 100 - #define SRCU_SIZE_WAIT_CBS1 4 101 - #define SRCU_SIZE_WAIT_CBS2 5 102 - #define SRCU_SIZE_WAIT_CBS3 6 103 - #define SRCU_SIZE_WAIT_CBS4 7 104 - #define SRCU_SIZE_BIG 8 95 + // Values for size state variable (->srcu_size_state). Once the state 96 + // has been set to SRCU_SIZE_ALLOC, the grace-period code advances through 97 + // this state machine one step per grace period until the SRCU_SIZE_BIG state 98 + // is reached. Otherwise, the state machine remains in the SRCU_SIZE_SMALL 99 + // state indefinitely. 100 + #define SRCU_SIZE_SMALL 0 // No srcu_node combining tree, ->node == NULL 101 + #define SRCU_SIZE_ALLOC 1 // An srcu_node tree is being allocated, initialized, 102 + // and then referenced by ->node. It will not be used. 103 + #define SRCU_SIZE_WAIT_BARRIER 2 // The srcu_node tree starts being used by everything 104 + // except call_srcu(), especially by srcu_barrier(). 105 + // By the end of this state, all CPUs and threads 106 + // are aware of this tree's existence. 107 + #define SRCU_SIZE_WAIT_CALL 3 // The srcu_node tree starts being used by call_srcu(). 108 + // By the end of this state, all of the call_srcu() 109 + // invocations that were running on a non-boot CPU 110 + // and using the boot CPU's callback queue will have 111 + // completed. 112 + #define SRCU_SIZE_WAIT_CBS1 4 // Don't trust the ->srcu_have_cbs[] grace-period 113 + #define SRCU_SIZE_WAIT_CBS2 5 // sequence elements or the ->srcu_data_have_cbs[] 114 + #define SRCU_SIZE_WAIT_CBS3 6 // CPU-bitmask elements until all four elements of 115 + #define SRCU_SIZE_WAIT_CBS4 7 // each array have been initialized. 116 + #define SRCU_SIZE_BIG 8 // The srcu_node combining tree is fully initialized 117 + // and all aspects of it are being put to use. 105 118 106 119 /* Values for state variable (bottom bits of ->srcu_gp_seq). */ 107 120 #define SRCU_STATE_IDLE 0