From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iu9PA-0003Ma-9Q for qemu-devel@nongnu.org; Mon, 19 Nov 2007 11:23:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iu9P9-0003MO-PE for qemu-devel@nongnu.org; Mon, 19 Nov 2007 11:23:24 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iu9P9-0003MJ-L6 for qemu-devel@nongnu.org; Mon, 19 Nov 2007 11:23:23 -0500 Received: from smtp.citrix.com ([66.165.176.89]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Iu9P9-0002WX-CQ for qemu-devel@nongnu.org; Mon, 19 Nov 2007 11:23:23 -0500 Date: Mon, 19 Nov 2007 16:23:19 +0000 From: Samuel Thibault Subject: Re: [Qemu-devel] Re: memory usage and ioports Message-ID: <20071119162319.GJ6331@implementation.uk.xensource.com> References: <20071119152016.GE6331@implementation.uk.xensource.com> <20071119153421.GH6331@implementation.uk.xensource.com> <200711191617.27138.paul@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <200711191617.27138.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: qemu-devel@nongnu.org Paul Brook, le Mon 19 Nov 2007 16:17:26 +0000, a écrit : > On Monday 19 November 2007, Samuel Thibault wrote: > > Samuel Thibault, le Mon 19 Nov 2007 15:20:16 +0000, a écrit : > > > Qemu currently uses 6 65k tables of pointers for handling ioports, which > > > makes 3MB on 64bit machines. There's a comment that says "XXX: use a two > > > level table to limit memory usage". But wouldn't it be more simple and > > > effective to just allocate them through mmap() and when a NULL pointer > > > is read, call the default handlers? > > > > For the ioport_opaque array (500KB on 64bit), it's much simpler, as the > > attached patch suggests. > > AFAICS This makes absolutely no difference to memory usage. Ah, sorry, in a unix environment it doesn't indeed. In an embedded environment or so which has to provide a fully allocated bss because it doesn't have cow support early enough, that makes a difference. Samuel