Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759081AbbDYKxs (ORCPT ); Sat, 25 Apr 2015 06:53:48 -0400 Received: from ud10.udmedia.de ([194.117.254.50]:44281 "EHLO mail.ud10.udmedia.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753101AbbDYKxp (ORCPT ); Sat, 25 Apr 2015 06:53:45 -0400 Date: Sat, 25 Apr 2015 12:53:42 +0200 From: Markus Trippelsdorf To: Hagen Paul Pfeifer Cc: Andrew Morton , "linux-kernel@vger.kernel.org" , Ingo Molnar , "H. Peter Anvin" , "David S. Miller" , "Paul E. McKenney" , x86@kernel.org Subject: Re: [PATCH] enforce function inlining for hot functions Message-ID: <20150425105342.GA396@x4> 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: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1674 Lines: 34 On 2015.04.24 at 22:39 +0200, Hagen Paul Pfeifer wrote: > On 24 April 2015 at 21:49, Andrew Morton wrote: > > 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. > > first of all you should probably scan over https://lkml.org/lkml/2015/4/21/178 > Some questions are already answered there. > > Here is the situation: the inlining problem occur with the 4.9.x > branch - I tried to reproduce it with 4.8.x and saw *no* problems. So > it is probably limited to 4.9 - which is sad. I don't checked it with > 5.0 or 5.1 yet. Then, if CONFIG_OPTIMIZE_INLINING is disabled inlining > is enforced anyway, so there is no problem because all inlined marked > functions are always inlined - gcc heuristic is defacto disabled. This > patch makes sure that the hot functions always inlined, no matter what > config is selected or compiler version is used. Yes, in an ideal world > gcc had inlined most of them - now we enforce the ideal world. Please note that this only happens with -Os (aka CONFIG_CC_OPTIMIZE_FOR_SIZE). The reason for this is that gcc simply doesn't inline when the function body would grow if the call is considered cold. -- Markus -- 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/