From: Ingo Molnar <mingo@kernel.org>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@intel.com>,
x86@kernel.org, linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Linus Torvalds <torvalds@linuxfoundation.org>
Subject: Re: [PATCH -tip] x86/locking/atomic: Use asm_inline for atomic locking insns
Date: Wed, 5 Mar 2025 20:55:35 +0100 [thread overview]
Message-ID: <Z8isNxBxC9pcG4KL@gmail.com> (raw)
In-Reply-To: <CAFULd4b=4rHcVAVSg_3yMb8=3ReiSriw_rM4vJL9_HvheXE92w@mail.gmail.com>
* Uros Bizjak <ubizjak@gmail.com> wrote:
> On Sat, Mar 1, 2025 at 1:38 PM Borislav Petkov <bp@alien8.de> wrote:
> >
> > On Sat, Mar 01, 2025 at 10:05:56AM +0100, Uros Bizjak wrote:
> > > OTOH, -Os, where different code size/performance heuristics are used, now
> > > performs better w.r.t code size.
> >
> > Did anything change since:
> >
> > 281dc5c5ec0f ("Give up on pushing CC_OPTIMIZE_FOR_SIZE")
> > 3a55fb0d9fe8 ("Tell the world we gave up on pushing CC_OPTIMIZE_FOR_SIZE")
> >
> > wrt -Os?
> >
> > Because if not, we still don't love -Os and you can drop the -Os argument.
>
> 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.
>
> > And without any perf data showing any improvement, this patch does nothing but
> > enlarge -O2 size...
>
> Even to my surprise, the patch has some noticeable effects on the
> performance, please see the attachment in [1] for LMBench data or [2]
> for some excerpts from the data. So, I think the patch has potential
> to improve the performance.
>
> [1] https://lore.kernel.org/lkml/CAFULd4YBcG45bigHBox2pu+To+Y5BzbRxG+pUr42AVOWSnfKsg@mail.gmail.com/
> [2] https://lore.kernel.org/lkml/CAFULd4ZsSKwJ4Dz3cCAgaVsa4ypbb0e2savO-3_Ltbs=1wzgKQ@mail.gmail.com/
If you are measuring micro-costs, please make sure you pin the workload
to a single CPU (via 'taskset' for example) and run 'perf stat --null
--repeat 5' or so to measure the run-over-run noise of the benchmark.
Thanks,
Ingo
next prev parent reply other threads:[~2025-03-05 19:55 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 12:35 [PATCH -tip] x86/locking/atomic: Use asm_inline for atomic locking insns Uros Bizjak
2025-02-28 13:13 ` Uros Bizjak
2025-02-28 16:48 ` Dave Hansen
2025-02-28 22:31 ` Uros Bizjak
2025-02-28 22:58 ` Dave Hansen
2025-03-01 9:05 ` Uros Bizjak
2025-03-01 12:38 ` Borislav Petkov
2025-03-05 8:54 ` Uros Bizjak
2025-03-05 17:04 ` Linus Torvalds
2025-03-05 19:40 ` Peter Zijlstra
2025-03-05 19:47 ` Uros Bizjak
2025-03-05 22:18 ` David Laight
2025-03-05 20:14 ` David Laight
2025-03-06 10:45 ` Uros Bizjak
2025-03-06 13:07 ` Uros Bizjak
2025-03-06 22:19 ` Ingo Molnar
2025-03-08 7:22 ` Uros Bizjak
2025-03-08 19:15 ` H. Peter Anvin
2025-03-05 19:55 ` Ingo Molnar [this message]
2025-03-05 20:13 ` Uros Bizjak
2025-03-05 20:21 ` Ingo Molnar
2025-03-06 9:38 ` Uros Bizjak
2025-03-05 20:20 ` Ingo Molnar
2025-03-06 10:52 ` Dirk Gouders
2025-03-06 10:59 ` Ingo Molnar
2025-03-05 20:36 ` Borislav Petkov
2025-03-05 21:26 ` Peter Zijlstra
2025-03-06 9:01 ` Uros Bizjak
2025-03-06 9:43 ` kernel: Current status of CONFIG_CC_OPTIMIZE_FOR_SIZE=y (was: Re: [PATCH -tip] x86/locking/atomic: Use asm_inline for atomic locking insns) Ingo Molnar
2025-03-06 10:37 ` Arnd Bergmann
2025-03-06 20:37 ` David Laight
2025-03-03 13:12 ` [PATCH -tip] x86/locking/atomic: Use asm_inline for atomic locking insns David Laight
2025-03-02 20:56 ` Uros Bizjak
2025-03-03 12:23 ` Uros Bizjak
2025-03-08 19:08 ` H. Peter Anvin
2025-03-09 7:50 ` Uros Bizjak
2025-03-09 9:46 ` David Laight
2025-03-09 9:57 ` Uros Bizjak
2025-03-06 9:57 ` Ingo Molnar
2025-03-06 10:26 ` Uros Bizjak
2025-03-06 10:38 ` Ingo Molnar
2025-03-06 10:50 ` Ingo Molnar
2025-03-06 13:56 ` Uros Bizjak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z8isNxBxC9pcG4KL@gmail.com \
--to=mingo@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linuxfoundation.org \
--cc=ubizjak@gmail.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.