mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gabriele Monaco <gmonaco@redhat.com>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: Nam Cao <namcao@linutronix.de>,
	linux-kernel@vger.kernel.org,
	 linux-trace-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	 Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH] rv: Add signal reactor
Date: Mon, 06 Oct 2025 17:19:24 +0200	[thread overview]
Message-ID: <2536a7777eb54ede40a335fa4204e87301b13040.camel@redhat.com> (raw)
In-Reply-To: <20251006115555-9822f5f1-fc9d-4d6a-9735-274b242e0eba@linutronix.de>

On Mon, 2025-10-06 at 12:10 +0200, Thomas Weißschuh wrote:
> Hi Gabriele,
> 
> > Well, many use cases might be better off with tracepoints, but reactors do
> > things tracepoints cannot really do.
> > Printk is much faster (and perhaps more reliable) than the trace buffer for
> > printing, panic can be used to gather a kernel dump.
> > One may just attach to tracepoints via libtracefs/BPF and do most of the
> > things you'd want to do with a new reactor, but I see reactors much easier
> > to use from scripts, for instance.
> > 
> > LTLs don't benefit as much as they don't print any additional information
> > via reactors, but DA/HA give hints on what's wrong.
> > 
> > I wouldn't get rid of reactors until they become a huge maintenance burden,
> > but probably we could think about it twice before extending or making them
> > more complex.
> 
> The existing reactors could be implemented on top of the tracepoints.
> This should make the RV core a bit simpler.
> 
> Note: The current interface between the RV core and the reactors is
> inflexible.
> Passing only opaque varargs requires all reactors to format the string from
> within the tracepoint handler, as they can not know how long the objects
> referenced by the varargs are valid. Passing the actual objects would allow
> for example the signal reactor to format its message as part of the task_work
> handler instead of the signal handler and avoid the allocation of a fixed size
> message buffer.

Yeah that's right current reactors don't really make sense for things that are
not printing. But as mentioned before, fitting this for all the different
monitors types (per-cpu/per-task or something more exotic) and model types (DA
or LTL) has its challenges.

I personally never really used the panic reactor to get a crash dump, but I'd
probably miss the printk one, since it's much faster than waiting for the
tracepoint stuff (at least when matching with other things on the ringbuffer).

As I get it, extending the reactors integration to support more things might not
be too useful, but I'm not too convinced on removing reactors for good.
I'm gonna give a little more thought on this one.

> > For instance, what's the exact use case of the signal reactor? Isn't it
> > simpler
> > to do everything in BPF? Is the signal needed at all or something else (e.g.
> > perf) would do the job?
> 
> The signal reactor is convenient to write automated tests. It can be used to
> validate the monitors by triggering known-bad systemcalls from a test
> executable and expect it to be killed with the reactor signal, see below for
> an example.
> On the other hand it can be used to validate that the kernel itself does not
> regress with respect to RV-validated properties. For example the test program
> can enable the rtapp monitor and run an example RT application using all kinds
> of known-good IPC mechanisms without it being killed.
> 

Yeah, what I meant is: having a signal isn't your goal. Easily understand if
there was a reaction is.
You could even restructure your test using tracepoints without any signal.

So if I get it correctly, you are both "voting" for removing reactors in favour
of tracepoint-only error reporting.
Am I getting this right?

Thanks,
Gabriele


  reply	other threads:[~2025-10-06 15:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 10:49 Thomas Weißschuh
2025-09-19 12:26 ` Gabriele Monaco
2025-09-22 16:29   ` Nam Cao
2025-09-23  7:42     ` Gabriele Monaco
2025-09-25 14:39       ` Thomas Weißschuh
2025-10-02 14:56         ` Nam Cao
2025-10-03  6:30           ` Gabriele Monaco
2025-10-06 10:10             ` Thomas Weißschuh
2025-10-06 15:19               ` Gabriele Monaco [this message]
2025-10-10 11:02                 ` Thomas Weißschuh
2025-10-10 13:02                   ` Gabriele Monaco
2025-10-10 12:12                 ` Nam Cao
2025-09-30 14:18     ` Thomas Weißschuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2536a7777eb54ede40a335fa4204e87301b13040.camel@redhat.com \
    --to=gmonaco@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=namcao@linutronix.de \
    --cc=rostedt@goodmis.org \
    --cc=thomas.weissschuh@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®