From mboxrd@z Thu Jan 1 00:00:00 1970 From: Theodore Tso Subject: Re: [patch] measurements, numbers about CONFIG_OPTIMIZE_INLINING=y impact Date: Fri, 9 Jan 2009 16:23:35 -0500 Message-ID: <20090109212335.GH23869@mit.edu> 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 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 To: Richard Guenther Return-path: In-Reply-To: <84fc9c000901091237i68b2e495tab55e61fb3dbd565@mail.gmail.com> List-ID: 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