Re: [PATCH v5 3/5] rv/reactors: export rv_register_reactor() and rv_unregister_reactor()
From: Wen Yang
Date: Sun Sep 13 2026 - 12:33:44 EST
On 9/11/26 14:53, Gabriele Monaco wrote:
On Mon, 2026-09-07 at 01:10 +0800, wen.yang@xxxxxxxxx wrote:Thanks for the review, Gabriele, I agree with your points and will follow them.
From: Wen Yang <wen.yang@xxxxxxxxx>
rv_react() is exported to modules, but the reactor registration helpers
are not. Export them with EXPORT_SYMBOL_GPL() so reactor modules and
the tristate KUnit test module can register and unregister reactors
without hitting undefined symbol errors at link time(modpost).
Commit 3d3800b4f7f4 ("rv: Remove reactor's reference counter") noted
that if module-based reactors are supported, try_module_get()/module_put()
should be used. Add struct module *owner to struct rv_reactor so a module
cat set owner = THIS_MODULE; pin the module in monitor_swap_reactors_gingle()
and release it when a monitor detaches or is unregistered.
You needed these symbols in KUnit and we are exporting them for /potential/
future support of reactors as modules. I don't see any technical reason why we
shouldn't support this, but they are currently /not/ supported.
I know sashiko and other LLMs complain about this, and they have a point, but
you can ignore them. At most state in this commit message that this does NOT add
support for reactors as modules.
Let's focus this series on its original intent (fix a lockdep warning and add
some KUnit tests that expose a reproducer), then if adding support for reactors
as modules is so simple, you can do it in another series.
If you really want to /also/ add support for reactors as modules in this series,
you need to make that very explicit (not just a vague line in the changelog, but
rather rewrite the entire cover letter and commit message).
And mind that this would mean your series needs to go through another round of
review and serious testing: you are adding a new feature.
Just to clarify the background : the struct module * field and the try_module_get()/module_put() logic were added to address the point raised by sashiko. After this change sashiko no longer complains about it.
The module-based reactor support, together with its kselftest, will be send as a separate series in a few days.
As a side note, we are looking into using the rv framework for functional safety in autonomous driving. Depending on how internal validation progress, there will likely be further changes to the rv subsystem in the near future. I'll be glad to discuss them as they come.
--
Best wishes,
Wen