[PATCH v3 00/22] Move notrace from inline to __always_inline

Song Liu song at kernel.org
Wed Dec 2 22:49:34 PST 2026


On Wed, Dec 2, 2026 at 6:33 PM Masami Hiramatsu (Google)
<mhiramat at kernel.org> wrote:
>
> On Wed, 2 Dec 2026 12:11:50 -0500, Steven Rostedt <rostedt at goodmis.org> wrote:
> > On Wed, 02 Dec 2026 22:49:41 +0900
> > "Masami Hiramatsu (Google)" <mhiramat at kernel.org> wrote:
> >
> > > More importantly, there is a structural maintainability problem.
> > > It is impossible to know in advance whether a `static inline` helper
> > > function will actually be inlined or generated as standalone code.
> > > Unlike `noinstr` on x86, there is no compile-time check tool
> > > (such as objtool) detecting - across different architectures -
> > > calls from a function marked `notrace` to a function that is
> > > traceable.
> > >
> > > So, I am opposed to making global semantic changes before such tools
> > > are in place.
> >
> > Could simply add a config to make all inline nops. If you really need
> > something inlined, you use __always_inline.
>
> As David mentioned, depends on the optimization level, normal
> "static" functions can be inlined silently. Maybe what Song need is
> a config option to set "-fno-inline". :(

Static functions being inlined silently is not an issue for livepatch.
The binary diff algorithm will figure out which function(s) really need
livepatching.

The issue is "inline annotation" plus "not inlined" (compiler decision)
means not livepatch-able. The proposed fix is to make inline
annotation does NOT automatically include "notrace".

Does this make sense?

Thanks,
Song



More information about the linux-arm-kernel mailing list