Re: [BUG] srcu: false-positive WARN in cleanup_srcu_struct() after 78a38cbf6f20
From: Sunho Park
Date: Tue Aug 25 2026 - 12:50:17 EST
On 8/25/26 21:33, Zqiang wrote:
In srcu_gp_end(), delayed work timer is always armed in SRCU_SIZE_SMALL mode regardless of whether its cblist has callbacks:
If srcu_barrier() be invoke before srcu_cleanup(), and after srcu_barrier()
completion, there are no concurrent srcu grace period start again (e.g. call_srcu() calls),
the timer_delete_sync() should return false, the rcu_segcblist_n_cbs()
will not be check.
Or did I miss something?
if (ss_state < SRCU_SIZE_WAIT_BARRIER) {
srcu_schedule_cbs_sdp(per_cpu_ptr(ssp->sda, get_boot_cpu_id()),
cbdelay);
} else {
...
}
and with cbdelay=1 (the non-expedited path) srcu_schedule_cbs_sdp() arms the per-CPU delay_work timer for the next jiffy. This includes the srcu_gp_end() whose grace period makes the barrier's callbacks ready, so an armed timer is left pending when srcu_invoke_callbacks() completes the barrier.
Thanks
Sunho Park