From: Gabriele Monaco <gmonaco@redhat.com>
To: 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 4/6] rv: Remove rv_reactor's reference counter
Date: Mon, 21 Jul 2025 17:49:02 +0200 [thread overview]
Message-ID: <eabfae8b0f29c88437cc51af21797e869d99aef6.camel@redhat.com> (raw)
In-Reply-To: <20250721140425.OeD16I4D@linutronix.de>
On Mon, 2025-07-21 at 16:04 +0200, Nam Cao wrote:
> On Mon, Jul 21, 2025 at 03:20:44PM +0200, Gabriele Monaco wrote:
> > Mmh, I'm not understanding how, let's assume I create a custom
> > reactor
> > as a kernel module and I want to use it on existing models (built
> > in or
> > modules themselves), I'd do.
> >
> > insmod myreactor
> > echo myreactor > mymodel/reactors
> > rmmod myreactor
> > ## I want this one to fail because the reactor is in use
> >
> > echo nop > mymodel/reactors
> > rmmod myreactor
> > # now it can succeed
> >
> > How is MODULE_SOFTDEP helping in this scenario?
> > Am I missing something here?
>
> You are right, MODULE_SOFTDEP does not help this use case.
>
> I did a quick search, it seems try_module_get() and module_put() are
> what we need for this. Let me amend the commit message.
>
I wasn't aware of it, then sure we should be using that.
> But my essential point in this patch is that, the current ref count
> implementation does not work. Furthermore, we should use the
> centralized kernel module's facilities, not implementing our own
> custom logic.
>
Yeah I get your point. If I understand you correctly, what's broken is
that we just return EBUSY and ignore that on __exit instead of doing
something about it (set nop to all monitors using this reactor).
I wonder if we shouldn't also fix this (using the module refcount).
But that can be done in the future, I'm not even sure reactors as
modules currently work.
Also, I'd need to verify this but depending on the order of exit
functions, we might be seeing the same problems with built-in reactors
when active on shutdown. I'm going to play a bit with this and see if
this workaround of not deleting the reactor was introduced for that (I
doubt though).
Thanks,
Gabriele
next prev parent reply other threads:[~2025-07-21 15:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 9:47 [PATCH 0/6] rv: Clean up & simplify Nam Cao
2025-07-21 9:47 ` [PATCH 1/6] rv: Remove unused field in struct rv_monitor_def Nam Cao
2025-07-21 13:01 ` Gabriele Monaco
2025-07-21 9:47 ` [PATCH 2/6] rv: Merge struct rv_monitor_def into struct rv_monitor Nam Cao
2025-07-21 14:13 ` Gabriele Monaco
2025-07-21 9:47 ` [PATCH 3/6] rv: Merge struct rv_reactor_def into struct rv_reactor Nam Cao
2025-07-21 14:29 ` Gabriele Monaco
2025-07-21 9:47 ` [PATCH 4/6] rv: Remove rv_reactor's reference counter Nam Cao
2025-07-21 13:20 ` Gabriele Monaco
2025-07-21 14:04 ` Nam Cao
2025-07-21 15:49 ` Gabriele Monaco [this message]
2025-07-22 8:27 ` Nam Cao
2025-07-22 8:30 ` Gabriele Monaco
2025-07-21 9:47 ` [PATCH 5/6] rv: Remove the nop reactor Nam Cao
2025-07-21 10:29 ` Gabriele Monaco
2025-07-21 14:10 ` Nam Cao
2025-07-21 9:47 ` [PATCH 6/6] rv: Remove struct rv_monitor::reacting Nam Cao
2025-07-21 14:38 ` Gabriele Monaco
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=eabfae8b0f29c88437cc51af21797e869d99aef6.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 \
/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).