[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFULd4ZsHKA4Yh9CsxPjdoW-fa7yD1-Ov7xDN4E3J3c8O8yQ7g@mail.gmail.com>
Date: Thu, 6 Mar 2025 10:01:31 +0100
From: Uros Bizjak <ubizjak@...il.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...el.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>, Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>, Linus Torvalds <torvalds@...uxfoundation.org>
Subject: Re: [PATCH -tip] x86/locking/atomic: Use asm_inline for atomic
locking insns
On Wed, Mar 5, 2025 at 10:26 PM Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Wed, Mar 05, 2025 at 09:36:33PM +0100, Borislav Petkov wrote:
> > On Wed, Mar 05, 2025 at 09:54:11AM +0100, Uros Bizjak wrote:
> > > The -Os argument was to show the effect of the patch when the compiler
> > > is instructed to take care of the overall size. Giving the compiler
> > > -O2 and then looking at the overall size of the produced binary is
> > > just wrong.
> >
> > No one cares about -Os AFAICT. It might as well be non-existent. So the effect
> > doesn't matter.
>
> Well, more people would care if it didn't stand for -Ostupid I suppose.
> That is, traditionally GCC made some very questionable choices with -Os,
> quite horrendous code-gen.
Size optimizations result in 15% code size reduction (x86_64
defconfig, gcc-14.2), so they reflect what user wanted:
text data bss dec hex filename
27478996 4635807 814660 32929463 1f676b7 vmlinux-O2.o
23859143 4617419 814724 29291286 1bef316 vmlinux-Os.o
The compiler heuristics depend on tradeoffs, and -Os uses different
tradeoffs than -O2. Unfortunately, there is no
-Os-but-I-really-want-performace switch, but OTOH, tradeoffs can be
adjusted. The compiler is open-source, and these adjustments can be
discussed in public spaces (mailing lists and bugzilla) and eventually
re-tuned. We are aware that the world around us changes, so tunings
are not set in stone, but we also depend on user feedback.
Thanks,
Uros.
Powered by blists - more mailing lists