summaryrefslogtreecommitdiff
path: root/kernel/rcu/tree.c
diff options
context:
space:
mode:
authorJoel Fernandes <joelagnelf@nvidia.com>2025-07-15 16:01:54 -0400
committerNeeraj Upadhyay <neeraj.iitr10@gmail.com>2025-07-22 17:10:31 +0530
commit186779c036468038b0d077ec5333a51512f867e5 (patch)
treea7cd463c843631cf2bdfe72e169316ee89869724 /kernel/rcu/tree.c
parent30a7806adab5f6b971cf07439ed6a3fac3fd80cf (diff)
rcu: Document separation of rcu_state and rnp's gp_seq
The details of this are subtle and was discussed recently. Add a quick-quiz about this and refer to it from the code, for more clarity. Reviewed-by: "Paul E. McKenney" <paulmck@kernel.org> Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com> Signed-off-by: Neeraj Upadhyay (AMD) <neeraj.upadhyay@kernel.org>
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r--kernel/rcu/tree.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 384af6b5cf9c..b206db119546 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1845,6 +1845,10 @@ static noinline_for_stack bool rcu_gp_init(void)
* use-after-free errors. For a detailed explanation of this race, see
* Documentation/RCU/Design/Requirements/Requirements.rst in the
* "Hotplug CPU" section.
+ *
+ * Also note that the root rnp's gp_seq is kept separate from, and lags,
+ * the rcu_state's gp_seq, for a reason. See the Quick-Quiz on
+ * Single-node systems for more details (in Data-Structures.rst).
*/
rcu_seq_start(&rcu_state.gp_seq);
/* Ensure that rcu_seq_done_exact() guardband doesn't give false positives. */