Re: [BUG] srcu: false-positive WARN in cleanup_srcu_struct() after 78a38cbf6f20
From: Sunho Park
Date: Thu Aug 27 2026 - 08:32:03 EST
On 8/27/26 20:35, Zqiang wrote:
I'm testing on the linux-next tree(next-20260821), regarding the commit [1].Which tree is your test based on? (rcu tree or linux-next tree)
The step5 srcu_barrier() has been intercept the srcu callback which by step4 call_srcu() insert,srcu_barrier() didn't return at that point, it returned at step 9 when srcu_invoke_callbacks() (which was queued to rcu_gp_wq at step 3) calls the barrier cb after finishing the real five __free_bus callbacks. Steps 3 through 9 all happen within the same jiffy, so the timer armed at step 6 for the next jiffy is still pending at step 9. Also, a stale n_cbs is left because, although srcu_invoke_callbacks()'s invoking loop may have finished at that point, the control flow has not yet reached the rcu_segcblist_add_len(-len) call at the end of srcu_invoke_callbacks().
so at here, the srcu_barrier should not be return, and the step4 srcu callback should not be run.
the cleanup_srcu_struct() also should not be called.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/kernel/rcu/srcutree.c?id=78a38cbf6f20bc8247e93d1149f97c12dba9fbfb
Thanks
Sunho Park