From: Gabriele Monaco <gmonaco@redhat.com>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Nam Cao" <namcao@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] rv: Add explicit lockdep context for reactors
Date: Tue, 14 Oct 2025 16:50:18 +0200 [thread overview]
Message-ID: <1014118845296ead20fc1f8ae64c4fa610d06bc0.camel@redhat.com> (raw)
In-Reply-To: <20251014160719-f5a075fa-7cdf-4367-8551-05cf7715a3e7@linutronix.de>
On Tue, 2025-10-14 at 16:18 +0200, Thomas Weißschuh wrote:
> On Tue, Oct 14, 2025 at 03:45:39PM +0200, Gabriele Monaco wrote:
> > On Tue, 2025-10-14 at 14:51 +0200, Thomas Weißschuh wrote:
> > > I can't follow here. lockdep can indicate problems, but it should not
> > > introduce
> > > problems on its own. So preventing the usage together with lockdep would
> > > be
> > > the
> > > proverbial head in the sand. If the tracepoints called by lockdep are an
> > > issue
> > > then we would just not call into lockdep in the first place. lockdep
> > > triggering
> > > these tracepoints should not be an issue in practice. I don't see a
> > > bulletproof
> > > way to prevent a tracepoint handler from calling another tracepoint,
> > > except
> > > maybe extending lockdep to also track that.
> >
> > Forget about it, you're right. This leads to not using lockdep inside
> > reactors
> > in the first place. We could even have notrace versions of the lockdep calls
> > (I'm not sure lockdep itself needs them), but that's getting horrid.
>
> I still don't understand why the tracepoints called from lockdep are worse
> then
> the ones called from the reactors themselves? Any solution should also apply
> to
> those. Especially as even the simplest printk reactor runs into the same
> issue.
They aren't in fact, so yes, we already had this problem without knowing about
it.
> > Leaving for a moment concurrency quirks aside, a monitor that is reacting
> > should be done for a while and can be marked as not monitoring before
> > reacting, instead of after.
> > Trace handlers triggered in the same tracepoints should, in principle, be
> > able to tell they are not supposed to run. This at least stands for DA
> > monitors, but the same idea could work on LTL as well.
> >
> > Of course this gets more complicated in practice, but perhaps suspending
> > monitors during reaction can be enough to allow these lockdep calls without
> > risking infinite loops.
>
> What would it mean to suspend a monitor? In my opinion we shouldn't sacrifice
> the accuracy of the monitors or the reliability of the reactors while trying
> to mitigate a theoretical problem.
I don't mean to really sacrifice accuracy, DA monitors are disabled after a
reaction. This comes from the assumption that the model becomes invalid, so
whatever comes after might be meaningless. Monitors restart as soon as we are
sure we reached the initial state.
In this case, it already doesn't make sense to monitor events triggered by
reactors.
LTL is a bit more complex, so it might make sense to continue monitoring just
after a reaction, but I'm not sure how useful that is.
next prev parent reply other threads:[~2025-10-14 14:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-14 5:51 [PATCH 0/3] rv: Add explicit lockdep context for reactors Thomas Weißschuh
2025-10-14 5:51 ` [PATCH 1/3] rv: Pass va_list to reactors Thomas Weißschuh
2025-10-14 7:08 ` Gabriele Monaco
2025-10-14 5:51 ` [PATCH 2/3] rv: Make rv_reacting_on() static Thomas Weißschuh
2025-10-14 5:51 ` [PATCH 3/3] rv: Add explicit lockdep context for reactors Thomas Weißschuh
2025-10-14 6:55 ` Gabriele Monaco
2025-10-14 7:13 ` Thomas Weißschuh
2025-10-14 7:38 ` Nam Cao
2025-10-14 9:46 ` Thomas Weißschuh
2025-10-14 10:22 ` Gabriele Monaco
2025-10-14 12:51 ` Thomas Weißschuh
2025-10-14 13:45 ` Gabriele Monaco
2025-10-14 14:18 ` Thomas Weißschuh
2025-10-14 14:50 ` Gabriele Monaco [this message]
2025-10-15 10:07 ` 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=1014118845296ead20fc1f8ae64c4fa610d06bc0.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;
as well as URLs for NNTP newsgroup(s).