From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/4] reduce kvm stack usage in kvm_arch_vm_ioctl() Date: Tue, 12 Aug 2008 16:00:08 +0300 Message-ID: <48A18958.8060307@qumranet.com> References: <1218474105-14678-1-git-send-email-dave@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm-devel , linux-kernel@vger.kernel.org To: Dave Hansen Return-path: Received: from il.qumranet.com ([212.179.150.194]:16334 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752110AbYHLNAN (ORCPT ); Tue, 12 Aug 2008 09:00:13 -0400 In-Reply-To: <1218474105-14678-1-git-send-email-dave@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Dave Hansen wrote: > On my machine with gcc 3.4, kvm uses ~2k of stack in a few > select functions. This is mostly because gcc fails to > notice that the different case: statements could have their > stack usage combined. It overflows very nicely if interrupts > happen during one of these large uses. > > This patch uses two methods for reducing stack usage. > 1. dynamically allocate large objects instead of putting > on the stack. > 2. Use a union{} member for all of the case variables. This > tricks gcc into combining them all into a single stack > allocation. (There's also a comment on this) > > Applied all, thanks. -- error compiling committee.c: too many arguments to function