Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757807AbZAIVYz (ORCPT ); Fri, 9 Jan 2009 16:24:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756264AbZAIVYL (ORCPT ); Fri, 9 Jan 2009 16:24:11 -0500 Received: from thunk.org ([69.25.196.29]:56236 "EHLO thunker.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756154AbZAIVYI (ORCPT ); Fri, 9 Jan 2009 16:24:08 -0500 Date: Fri, 9 Jan 2009 16:23:35 -0500 From: Theodore Tso To: Richard Guenther Cc: Linus Torvalds , Matthew Wilcox , Andi Kleen , Dirk Hohndel , "H. Peter Anvin" , Ingo Molnar , jim owens , Chris Mason , Peter Zijlstra , Steven Rostedt , paulmck@linux.vnet.ibm.com, Gregory Haskins , Andrew Morton , Linux Kernel Mailing List , linux-fsdevel , linux-btrfs , Thomas Gleixner , Nick Piggin , Peter Morreale , Sven Dietrich , jh@suse.cz Subject: Re: [patch] measurements, numbers about CONFIG_OPTIMIZE_INLINING=y impact Message-ID: <20090109212335.GH23869@mit.edu> Mail-Followup-To: Theodore Tso , Richard Guenther , Linus Torvalds , Matthew Wilcox , Andi Kleen , Dirk Hohndel , "H. Peter Anvin" , Ingo Molnar , jim owens , Chris Mason , Peter Zijlstra , Steven Rostedt , paulmck@linux.vnet.ibm.com, Gregory Haskins , Andrew Morton , Linux Kernel Mailing List , linux-fsdevel , linux-btrfs , Thomas Gleixner , Nick Piggin , Peter Morreale , Sven Dietrich , jh@suse.cz References: <20090109172011.GD26290@one.firstfloor.org> <20090109172801.GC6936@parisc-linux.org> <20090109174719.GG26290@one.firstfloor.org> <20090109173914.GD6936@parisc-linux.org> <84fc9c000901091109t2c2aef2fu596f8807b0962688@mail.gmail.com> <84fc9c000901091214i16fc74b7q349433a5586d5619@mail.gmail.com> <84fc9c000901091237i68b2e495tab55e61fb3dbd565@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84fc9c000901091237i68b2e495tab55e61fb3dbd565@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@mit.edu X-SA-Exim-Scanned: No (on thunker.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1254 Lines: 23 I'm beginning to think that for the kernel, we should just simply remove CONFIG_OPTIMIZE_INLINING (so that inline means "always_inline"), and -fno-inline-functions -fno-inline-functions-called-one (so that gcc never inlines functions behind our back) --- and then we create tools that count how many times functions get used, and how big functions are, so that we can flag if some function really should be marked inline when it isn't or vice versa. But given that this is a very hard thing for an automated program todo, let's write some tools so we can easily put a human in the loop, who can add or remove inline keywords where it makes sense, and let's give up on gcc being able to "guess" correctly. For some things, like register allocation, I can accept that the compiler will usually get these things right. But whether or not to inline a function seems to be one of those things that humans (perhaps with some tools assist) can still do a better job than compilers. - Ted -- 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/