Re: [PATCH] rv: Represent uninitialised and dying DA monitors

From: Gabriele Monaco

Date: Thu Dec 03 2026 - 09:19:58 EST


On Thu, 2026-12-03 at 02:15 +0800, Wen Yang wrote:
> Hi Gabriele,
>
> Thanks, this is exactly what we need.
> We v9 series will rebase on top of it.
>
> One question: started now guards the timer instead of monitoring, which
> was published with release/acquire. Should it follow the same pattern?
>
> ...
> smp_store_release(&da_mon->started, true);
> return smp_load_acquire(&da_mon->started);
>
> Reviewed-by: Wen Yang <wen.yang@xxxxxxxxx>
>

Hi Wen,

thanks for the review.

I'm still ruminating on this solution.
Certainly we need release/acquire semantics here too.

I'm a bit in doubt with the other reader of started: ha_monitor_init_env()

Here I'm trying to fix another potential race that runs double initialisation by
using the same started flag.
I got paranoid about it, but I now believe that if there cannot be concurrent
start events for the same monitors, this patch should solve that too.

That's already an assumption we have, though I probably need to make it more
explicit in a comment.

Thoughts?

Gabriele