All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Markus Trippelsdorf <markus@trippelsdorf.de>
Cc: Hagen Paul Pfeifer <hagen@jauu.net>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Borislav Petkov <bp@alien8.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH RFC] x86: enforce inlining for atomics
Date: Wed, 22 Apr 2015 11:28:50 +0200	[thread overview]
Message-ID: <20150422092850.GA24664@gmail.com> (raw)
In-Reply-To: <20150422092040.GB395@x4>


* Markus Trippelsdorf <markus@trippelsdorf.de> wrote:

> On 2015.04.22 at 07:58 +0200, Hagen Paul Pfeifer wrote:
> > * Markus Trippelsdorf | 2015-04-22 07:24:41 [+0200]:
> > >I cannot reproduce this issue with my config with 4.8, 4.9 or 5. Could
> > >you please come up with a small testcase and open a gcc bug (with full
> > >gcc command line)?
> > 
> > the attached config file should do the trick. Can you try it?
> 
> It is definitely a -O2 vs. -Os issue. With your config:
> 
> -Os:
>  % nm vmlinux | grep " atomic_" | wc -l
> 736 
> 
> -O2 is fine:
>  % nm vmlinux | grep " atomic_"
> ffffffff852d8300 r atomic_counters_ops
> ffffffff83d66bf0 t atomic_counters_read
> ffffffff8119cd30 T atomic_dec_and_mutex_lock
> ffffffff81172e10 T atomic_notifier_call_chain
> ffffffff81172b90 T atomic_notifier_chain_register
> ffffffff81172d70 T atomic_notifier_chain_unregister
> ffffffff844b0ef0 t atomic_read_file
> ffffffff85a0c260 r atomic_ro_fops
> ffffffff87616000 d atomic_rw
> ffffffff852d8400 r atomic_stats_ops
> ffffffff83d66c50 t atomic_stats_read
> 
> The easiest fix would be to force always-inline in
> include/linux/compiler-gcc.h when CONFIG_CC_OPTIMIZE_FOR_SIZE is set.

That pretty much defeats the purpose of any inlining size calculations 
on -Os - and would make it impossible for better or bugfixed compilers 
to improve the situation.

So I think the original patch makes sense (and I already applied it), 
we want known-simple and performance critical methods (such as atomic 
ops) always inlined.

Thanks,

	Ingo

  reply	other threads:[~2015-04-22  9:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-20 21:27 [PATCH RFC] x86: enforce inlining for atomics Hagen Paul Pfeifer
2015-04-20 21:56 ` Borislav Petkov
2015-04-20 22:08   ` Hagen Paul Pfeifer
2015-04-21  7:42     ` Ingo Molnar
2015-04-21 10:56       ` Hagen Paul Pfeifer
2015-04-21 22:57       ` Hagen Paul Pfeifer
2015-04-22  0:57         ` Linus Torvalds
2015-04-22  5:24         ` Markus Trippelsdorf
2015-04-22  5:58           ` Hagen Paul Pfeifer
2015-04-22  9:20             ` Markus Trippelsdorf
2015-04-22  9:28               ` Ingo Molnar [this message]
2015-04-22  9:31                 ` Hagen Paul Pfeifer
2015-04-30  1:52                   ` Henrique de Moraes Holschuh
2015-07-13 18:27                 ` Denys Vlasenko
2015-07-13 19:20                   ` Hagen Paul Pfeifer
2015-07-13 21:06                     ` Denys Vlasenko
2015-07-13 21:12                       ` Hagen Paul Pfeifer
2015-07-13 18:25               ` Denys Vlasenko
2015-04-20 23:46 ` Peter Zijlstra
2015-04-22 14:10 ` [tip:x86/asm] x86/asm: Always inline atomics tip-bot for Hagen Paul Pfeifer

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=20150422092850.GA24664@gmail.com \
    --to=mingo@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=hagen@jauu.net \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus@trippelsdorf.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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.