From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LsPGQ-0007Za-7p for qemu-devel@nongnu.org; Fri, 10 Apr 2009 18:31:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LsPGK-0007S9-Rn for qemu-devel@nongnu.org; Fri, 10 Apr 2009 18:31:57 -0400 Received: from [199.232.76.173] (port=40227 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LsPGK-0007Rq-L3 for qemu-devel@nongnu.org; Fri, 10 Apr 2009 18:31:52 -0400 Received: from mail2.shareable.org ([80.68.89.115]:59376) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LsPGK-0002jK-9M for qemu-devel@nongnu.org; Fri, 10 Apr 2009 18:31:52 -0400 Received: from jamie by mail2.shareable.org with local (Exim 4.63) (envelope-from ) id 1LsPGG-0006AW-Ix for qemu-devel@nongnu.org; Fri, 10 Apr 2009 23:31:48 +0100 Date: Fri, 10 Apr 2009 23:31:48 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH] two level table for IO port lookup Message-ID: <20090410223148.GA23259@shareable.org> References: <1239374905.28083.21.camel@nibbler.dlib.indiana.edu> <49DF6DD0.3090508@codemonkey.ws> <1239390492.20162.63.camel@nibbler.dlib.indiana.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1239390492.20162.63.camel@nibbler.dlib.indiana.edu> 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 Brian Wheeler wrote: > On Fri, 2009-04-10 at 11:03 -0500, Anthony Liguori wrote: > > Brian Wheeler wrote: > > > The alpha architecture uses 24 bits for the io port address so this > > > patch adds a two level table and puts the IO port data into a > > > struct...because sizeof(void *) * 7 * 16777216 is nearly a 1G on my > > > workstation. > > > > > > I've set the alpha target to use a 12/12 split and everything else to > > > use 8/8. > > > > > > > The table lookups really kill performance. It's probably a better idea > > just to switch to a linear list of IO ports. There's usually going to > > be a small number of registered IO regions (certainly, less than 100). > > Well, on ioport_read the hot path does 2 lookups and a null check. The > new one does 3 lookups, and two null checks. You could reduce it to one null check by pointing null top-level entries to an a shared all-nulls leaf table. I doubt it would make any difference to performance though. -- Jamie