Received: from [140.186.70.92] (port=34502 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYkvQ-0005D9-Bi for qemu-devel@nongnu.org; Fri, 31 Dec 2010 14:46:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PYkvN-0000fu-Fm for qemu-devel@nongnu.org; Fri, 31 Dec 2010 14:46:08 -0500 Received: from hall.aurel32.net ([88.191.126.93]:39139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PYkvN-0000ff-BB for qemu-devel@nongnu.org; Fri, 31 Dec 2010 14:46:05 -0500 Date: Fri, 31 Dec 2010 20:46:02 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] TCG: Improve tb_phys_hash_func() Message-ID: <20101231194602.GF3615@hall.aurel32.net> References: <1293658044-10244-1-git-send-email-aurelien@aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: Sender: Aurelien Jarno List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On Thu, Dec 30, 2010 at 05:55:38PM +0000, Blue Swirl wrote: > On Wed, Dec 29, 2010 at 9:27 PM, Aurelien Jarno wrote: > > Most of emulated CPU have instructions aligned on 16 or 32 bits, while > > on others GCC tries to align the target jump location. This means that > > 1/2 or 3/4 of tb_phys_hash entries are never used. > > > > Update the hash function tb_phys_hash_func() to ignore the two lowest > > bits of the address. This brings a 6% speed-up when booting a MIPS > > image. > > Nice! The beginning of functions may be aligned to 16 bytes. Would it > change the performance figures if one or two more bits were ignored? > It makes a noticeable difference on how the TBs are dispatched in the hash table, but only by a few percents (slightly more on ppc). I am not able to measure any speed improvement, it is all in the noise. My guess is that compilers align functions to 16 bytes, but not jump in loops, which are far more numerous that functions starts. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net