From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iu9Jd-0000AL-99 for qemu-devel@nongnu.org; Mon, 19 Nov 2007 11:17:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iu9Jb-00008H-Mm for qemu-devel@nongnu.org; Mon, 19 Nov 2007 11:17:39 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iu9Jb-00008E-JW for qemu-devel@nongnu.org; Mon, 19 Nov 2007 11:17:39 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Iu9Jb-0000yk-6w for qemu-devel@nongnu.org; Mon, 19 Nov 2007 11:17:39 -0500 From: Paul Brook Subject: Re: [Qemu-devel] Re: memory usage and ioports Date: Mon, 19 Nov 2007 16:17:26 +0000 References: <20071119152016.GE6331@implementation.uk.xensource.com> <20071119153421.GH6331@implementation.uk.xensource.com> In-Reply-To: <20071119153421.GH6331@implementation.uk.xensource.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <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: qemu-devel@nongnu.org Cc: Samuel Thibault On Monday 19 November 2007, Samuel Thibault wrote: > Samuel Thibault, le Mon 19 Nov 2007 15:20:16 +0000, a =E9crit : > > 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. Paul