]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rcu/kfree: Warn on unexpected tail state
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 18 Jun 2024 17:40:30 +0000 (10:40 -0700)
committerNeeraj Upadhyay <neeraj.upadhyay@kernel.org>
Mon, 29 Jul 2024 02:13:06 +0000 (07:43 +0530)
Within the rcu_sr_normal_gp_cleanup_work() function, there is an acquire
load from rcu_state.srs_done_tail, which is expected to be non-NULL.
This commit adds a WARN_ON_ONCE() to check this expectation.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Neeraj Upadhyay <neeraj.upadhyay@kernel.org>
kernel/rcu/tree.c

index e641cc681901a5e5c7a7e1791a836ba0db89d7d3..0f41a81138dce91c6247c91588757e080bdd33f6 100644 (file)
@@ -1649,7 +1649,7 @@ static void rcu_sr_normal_gp_cleanup_work(struct work_struct *work)
         * the done tail list manipulations are protected here.
         */
        done = smp_load_acquire(&rcu_state.srs_done_tail);
-       if (!done)
+       if (WARN_ON_ONCE(!done))
                return;
 
        WARN_ON_ONCE(!rcu_sr_is_wait_head(done));