Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934499AbbDVJ3A (ORCPT ); Wed, 22 Apr 2015 05:29:00 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:34900 "EHLO mail-wg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934463AbbDVJ25 (ORCPT ); Wed, 22 Apr 2015 05:28:57 -0400 Date: Wed, 22 Apr 2015 11:28:50 +0200 From: Ingo Molnar To: Markus Trippelsdorf Cc: Hagen Paul Pfeifer , Linus Torvalds , Borislav Petkov , "linux-kernel@vger.kernel.org" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra , Andrew Morton Subject: Re: [PATCH RFC] x86: enforce inlining for atomics Message-ID: <20150422092850.GA24664@gmail.com> References: <1429565231-4609-1-git-send-email-hagen@jauu.net> <20150420215645.GC10191@pd.tnic> <20150421074212.GA25081@gmail.com> <20150421225723.GA5927@virgo.local> <20150422052441.GA395@x4> <20150422055848.GA3307@virgo.local> <20150422092040.GB395@x4> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150422092040.GB395@x4> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1780 Lines: 50 * Markus Trippelsdorf 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/