From: Paul E. McKenney Date: Tue, 18 Jun 2024 17:40:30 +0000 (-0700) Subject: rcu/kfree: Warn on unexpected tail state X-Git-Tag: v6.12-rc1~166^2^8~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3471e96bcf53731639587580fd02e5a297940b91;p=thirdparty%2Flinux.git rcu/kfree: Warn on unexpected tail state 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 Signed-off-by: Neeraj Upadhyay --- diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index e641cc681901a..0f41a81138dce 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -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));