Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 5 Mar 2003 16:30:35 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 5 Mar 2003 16:30:35 -0500 Received: from wohnheim.fh-wedel.de ([195.37.86.122]:55942 "EHLO wohnheim.fh-wedel.de") by vger.kernel.org with ESMTP id ; Wed, 5 Mar 2003 16:30:00 -0500 Date: Wed, 5 Mar 2003 22:40:17 +0100 From: =?iso-8859-1?Q?J=F6rn?= Engel To: "Randy.Dunlap" Cc: Russell King , kraxel@bytesex.org, linux-kernel@vger.kernel.org Subject: Re: reducing stack usage in v4l? Message-ID: <20030305214017.GA25225@wohnheim.fh-wedel.de> References: <32833.4.64.238.61.1046841945.squirrel@www.osdl.org> <87u1eigomv.fsf@bytesex.org> <20030305093534.A8883@flint.arm.linux.org.uk> <20030305073437.0673458e.rddunlap@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20030305073437.0673458e.rddunlap@osdl.org> User-Agent: Mutt/1.3.28i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2450 Lines: 49 On Wed, 5 March 2003 07:34:37 -0800, Randy.Dunlap wrote: > Russell King wrote: > | On Wed, Mar 05, 2003 at 10:15:52AM +0100, Gerd Knorr wrote: > > | > Not sure what is the best idea to fix that. Don't like the kmalloc > | > idea that much. The individual structs are not huge, the real problem > | > is that many of them are allocated and only few are needed. Any > | > chance to tell gcc that it should allocate block-local variables at > | > the start block not at the start of the function? > | > | Not a particularly clean idea, but maybe creating a union of the > | structures and putting that on the stack? (ie, doing what GCC should > | be doing in the first place.) > > That's an idea. Or make separate called functions for each ioctl and declare > the structures inside them? As far as I have seen, at least ds_ioctl uses the union trick. And the three marked (*) ioctl-functions appear to be suffering from the same gcc inability. How much complaining is necessary for the gcc folks to worry about this? 0xc0ad420b : sub $0x814,%esp 0xc06dbd77 : sub $0x804,%esp 0xc0521e43 : sub $0x528,%esp * 0xc01ed733 : sub $0x4d0,%esp * 0xc0bfbfd3 : sub $0x474,%esp 0xc07968bb : sub $0x394,%esp * 0xc068ff5b : sub $0x2e0,%esp 0xc0583a63 : sub $0x2c8,%esp 0xc0865963 : sub $0x2ac,%esp 0xc04370c3 : sub $0x29c,%esp 0xc054c5eb : sub $0x290,%esp 0xc0299b23 : sub $0x278,%esp 0xc0532e67 : sub $0x230,%esp J?rn -- Optimizations always bust things, because all optimizations are, in the long haul, a form of cheating, and cheaters eventually get caught. -- Larry Wall - 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/