]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rcu: Clarify fill-the-gap comment in rcu_segcblist_advance()
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 2 Feb 2022 17:10:04 +0000 (09:10 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 12 Apr 2022 00:28:48 +0000 (17:28 -0700)
Reported-by: Frederic Weisbecker <frederic@kernel.org>
Reported-by: Neeraj Upadhyay <quic_neeraju@quicinc.com>
Reported-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/rcu_segcblist.c

index 81145c3ece25fab1f089a2e0eeaee80776d55c23..c54ea2b6a36bc2e969ee59b33b18bec0413fad2d 100644 (file)
@@ -505,10 +505,10 @@ void rcu_segcblist_advance(struct rcu_segcblist *rsclp, unsigned long seq)
                WRITE_ONCE(rsclp->tails[j], rsclp->tails[RCU_DONE_TAIL]);
 
        /*
-        * Callbacks moved, so clean up the misordered ->tails[] pointers
-        * that now point into the middle of the list of ready-to-invoke
-        * callbacks.  The overall effect is to copy down the later pointers
-        * into the gap that was created by the now-ready segments.
+        * Callbacks moved, so there might be an empty RCU_WAIT_TAIL
+        * and a non-empty RCU_NEXT_READY_TAIL.  If so, copy the
+        * RCU_NEXT_READY_TAIL segment to fill the RCU_WAIT_TAIL gap
+        * created by the now-ready-to-invoke segments.
         */
        for (j = RCU_WAIT_TAIL; i < RCU_NEXT_TAIL; i++, j++) {
                if (rsclp->tails[j] == rsclp->tails[RCU_NEXT_TAIL])