Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966978AbbDXUNs (ORCPT ); Fri, 24 Apr 2015 16:13:48 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:53747 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966783AbbDXUNq (ORCPT ); Fri, 24 Apr 2015 16:13:46 -0400 Date: Fri, 24 Apr 2015 13:13:40 -0700 From: "Paul E. McKenney" To: Andrew Morton Cc: Hagen Paul Pfeifer , linux-kernel@vger.kernel.org, Ingo Molnar , "H. Peter Anvin" , "David S. Miller" , x86@kernel.org Subject: Re: [PATCH] enforce function inlining for hot functions Message-ID: <20150424201340.GD5561@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <1429825201-2825-1-git-send-email-hagen@jauu.net> <20150424124905.07e29a3b1392513144cd1568@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150424124905.07e29a3b1392513144cd1568@linux-foundation.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15042420-0021-0000-0000-00000A0FEFC0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1968 Lines: 47 On Fri, Apr 24, 2015 at 12:49:05PM -0700, Andrew Morton wrote: > On Thu, 23 Apr 2015 23:40:01 +0200 Hagen Paul Pfeifer wrote: > > > GCC inlining heuristics are sometimes quizzical. Especially with inline > > assembler constructs GCC seems to have issues. A allyesconfig show a rather > > long list of functions where GCC inlining decisions are questionable (not > > inlined). > > I can't reproduce this with either gcc-4.8.2 or gcc-4.4.4. The patch > makes zero difference to `size vmlinux' and a bit of poking around with > nm doesn't show any out-of-lined versions of the functions you > identify. > > So. More details, please. How to demonstrate this, gcc versions, etc. > > > Furthermore, because the functions are declared with static > > linkage each function is copied n times - and n can be rather high: > > > > atomic_inc: 544 duplicates > > rcu_read_unlock: 453 duplicates > > rcu_read_lock: 383 duplicates Hmmm... allyesconfig would have PROVE_RCU=y, which would mean that the above two would contain lockdep calls that might in some cases defeat inlining. With the more typical production choice of PROVE_RCU=n, I would expect these to just be a call instruction, which should get inlined. Thanx, Paul > > get_dma_ops: 271 duplicates > > arch_local_irq_restore: 258 duplicates > > atomic_dec: 215 duplicates > > kzalloc: 185 duplicates > > cpumask_check: 157 duplicates > > test_and_set_bit: 156 duplicates > > cpumask_next: 146 duplicates > > list_del: 131 duplicates > > kref_get: 126 duplicates > > That's pretty pathetic. > -- 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/