lkml.org 
[lkml]   [2025]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] noinstr: Use asm_inline() in instrumentation_{begin,end}()
On Mon, Apr 14, 2025 at 05:27:11PM -0700, Josh Poimboeuf wrote:
> Use asm_inline() in the instrumentation begin/end macros to prevent the
> compiler from making poor inlining decisions based on the length of the
> objtool annotations.
>
> Without the objtool annotations, each macro resolves to a single NOP.
> Using inline_asm() seems obviously correct here as it accurately
> communicates the actual code size to the compiler.
>
> These macros are used by WARN() and lockdep, so this change can affect a
> lot of functions.
>
> For a defconfig kernel built with GCC 14.2.1, bloat-o-meter reports a
> 0.17% increase in text size:
>
> add/remove: 74/352 grow/shrink: 914/353 up/down: 80747/-47120 (33627)
> Total: Before=19460272, After=19493899, chg +0.17%

Hmm, I was surprised that defconfig was affected at all. Why does
defconfig have DEBUG_ENTRY on?

\
 
 \ /
  Last update: 2025-04-15 09:49    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog