Re: [PATCH 5/6] rv: Remove the nop reactor

From: Nam Cao
Date: Mon Jul 21 2025 - 10:11:25 EST


On Mon, Jul 21, 2025 at 12:29:24PM +0200, Gabriele Monaco wrote:
> On Mon, 2025-07-21 at 11:47 +0200, Nam Cao wrote:
> > As suggested by the name, the nop reactor does not do anything. It is
> > the
> > default reactor when nothing else is selected.
> >
> > However, the monitors already null-check the reactor function
> > pointers.
> > Thus, instead of a nop reactor, just set the react function pointer
> > to
> > NULL. The nop reactor can then be removed.
> >
> > Signed-off-by: Nam Cao <namcao@xxxxxxxxxxxxx>
>
> Thanks for the patch, I'd need to go through this a bit more in detail.
>
> As far as I remember, the only way to disable reaction is to set it to
> the nop reactor.
> With your patch the behaviour changes and, to disable the reactor, you
> now need to write an empty string, this should be documented somewhere,
> at the very least. Perhaps userspace tools (tools/verification/rv)
> might break and would need adaptation.
>
> We could still remove the kernel side implementation, but from
> userspace (tracefs) we might want to keep the nop reactor available,
> setting it would set the reactor to NULL under the hood.
>
> If you really want to change also the user space interface, we might
> want to imitate other tracefs features and use something like printk /
> !printk to enable/disable a reactor.
>
> What do you think? Did I miss anything here?

You didn't miss anything, I miss that this "nop" interface is inspired by
tracefs.

Although I prefer writing empty string, compared to writing "nop"; it is
better to be consistent with tracefs.

Let me drop this patch.

Best regards,
Nam