[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ivrnem5v2svx72fi5i5ibobdihjlal6cfibtimmzicar2pxkeb@qtlnpkakmkoq>
Date: Tue, 15 Apr 2025 07:52:47 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...nel.org>, Uros Bizjak <ubizjak@...il.com>
Subject: Re: [PATCH v2] noinstr: Use asm_inline() in
instrumentation_{begin,end}()
On Tue, Apr 15, 2025 at 09:48:49AM +0200, Peter Zijlstra wrote:
> 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?
Hm, looks like Ingo enabled that with:
70c8dc910427 ("x86/defconfig: Enable CONFIG_DEBUG_ENTRY=y")
Though, is there any reason NOINSTR validation needs to depend on
DEBUG_ENTRY?
--
Josh
Powered by blists - more mailing lists