Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754810AbZAIT3d (ORCPT ); Fri, 9 Jan 2009 14:29:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752857AbZAIT3X (ORCPT ); Fri, 9 Jan 2009 14:29:23 -0500 Received: from palinux.external.hp.com ([192.25.206.14]:55158 "EHLO mail.parisc-linux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752674AbZAIT3W (ORCPT ); Fri, 9 Jan 2009 14:29:22 -0500 Date: Fri, 9 Jan 2009 12:29:18 -0700 From: Matthew Wilcox To: Andi Kleen Cc: Linus Torvalds , 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: <20090109192918.GE6936@parisc-linux.org> References: <20090109084620.3c711aad@infradead.org> <20090109172011.GD26290@one.firstfloor.org> <20090109172801.GC6936@parisc-linux.org> <20090109174719.GG26290@one.firstfloor.org> <20090109094142.367012b6@infradead.org> <20090109180213.GH26290@one.firstfloor.org> <20090109185509.GJ26290@one.firstfloor.org> <20090109193506.GL26290@one.firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090109193506.GL26290@one.firstfloor.org> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1814 Lines: 47 On Fri, Jan 09, 2009 at 08:35:06PM +0100, Andi Kleen wrote: > - Also inline everything static that is only called once > [on the theory that this shrinks code size which is true > according to my measurements] > > -fno-inline-functions-called once disables this new rule. > It's very well and clearly defined. It's also not necessarily what we want. For example, in fs/direct-io.c, we have: static ssize_t direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode, const struct iovec *iov, loff_t offset, unsigned long nr_segs, unsigned blkbits, get_block_t get_block, dio_iodone_t end_io, struct dio *dio) { [150 lines] } ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, struct block_device *bdev, const struct iovec *iov, loff_t offset, unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, int dio_lock_type) { [100 lines] retval = direct_io_worker(rw, iocb, inode, iov, offset, nr_segs, blkbits, get_block, end_io, dio); [10 lines] } Now, I'm not going to argue the directIO code is a shining example of how we want things to look, but we don't really want ten arguments being marshalled into a function call; we want gcc to inline the direct_io_worker() and do its best to optimise the whole thing. -- Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." -- 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/