Re: [PATCH RFC 3/5] noinstr: Use asm_inline() in instrumentation_{begin,end}()

From: Ingo Molnar
Date: Tue Apr 08 2025 - 04:30:33 EST



* Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:

> Use asm_inline() to prevent the compiler from making poor inlining
> decisions based on the length of the objtool annotations.
>
> For a defconfig kernel built with GCC 14.2.1, bloat-o-meter reports a
> 0.18% text size increase:
>
> add/remove: 88/433 grow/shrink: 967/487 up/down: 87579/-52630 (34949)
> Total: Before=19448407, After=19483356, chg +0.18%
>
> Presumably the text growth is due to increased inlining. A net total of
> 345 functions were removed.

Since +0.18% puts this into the 'significant' category of .text size
increases, it would be nice to see a bit more details about the nature
of these function calls removed: were they really explicit calls to
__instrumentation_begin()/end(), or somehow tail-call optimized out, or
something else?

Also, I'm wondering where the 34,949 bytes bloat comes from: with 345
functions removed that's 100 bytes per function? Doesn't sound right.

Also, is the bloat-o-meter output limited to the .text section, or does
it include growth in out-of-line sections too?

Thanks,

Ingo