Re: [PATCH v8 04/14] rv: Disarm HA timers on the storage free path
From: Gabriele Monaco
Date: Wed Dec 02 2026 - 02:12:58 EST
On Wed, 2026-12-02 at 02:14 +0100, Karl Mehltretter wrote:
> I was thinking about disable followed by re-enable.
>
> Storages already unlinked by da_destroy_storage() are no longer in
> da_monitor_ht, and synchronize_rcu() does not wait for their da_kfree_cb()
> callbacks to run.
>
> If a timer is still armed on one of those storages, re-enabling clears
> ha_mon_destroying before da_kfree_cb() cancels it, so the old timer can fire
> and report a violation in the new session.
>
> I reproduced this with nomiss using rcu_nocbs=all and delays in
> da_destroy_storage() and da_kfree_cb().
>
> A timer from before disable fired after re-enable, and rcu_barrier() in
> da_monitor_destroy() stopped it.
>
> Your dead flag would have prevented that. But with init-once timers and
> unconditional cancel on free, da_monitor_destroy() still needs rcu_barrier().
Oh I see, thanks for the analysis.
So what you're proposing is to have this patch (4/14) add also an rcu_barrier:
da_monitor_destroy() {
+ rcu_barrier();
}
And the next 7/14 not touch the barrier, which is already there, and only
conditionally mempool_exit().
Right?
It might prolong a bit the monitor disable in some configuration but it's better
safe than sorry, we can go down that path.
Thanks,
Gabriele