From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ao5aS-0007Oi-SA for qemu-devel@nongnu.org; Thu, 07 Apr 2016 04:46:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ao5aN-0000UI-SO for qemu-devel@nongnu.org; Thu, 07 Apr 2016 04:46:48 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:36302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ao5aN-0000U5-LG for qemu-devel@nongnu.org; Thu, 07 Apr 2016 04:46:43 -0400 Received: by mail-wm0-x244.google.com with SMTP id l6so2402133wml.3 for ; Thu, 07 Apr 2016 01:46:42 -0700 (PDT) Sender: Paolo Bonzini References: <1459834253-8291-8-git-send-email-cota@braap.org> <5703DCB7.50302@twiddle.net> <5703DE37.3080306@redhat.com> <5703E2DD.3020103@twiddle.net> <20160405194028.GA6671@flamenco> <5704293D.1070105@twiddle.net> <20160406005239.GA25081@flamenco> <5704F875.90509@redhat.com> <20160406174439.GB27512@flamenco> <5705542E.60708@redhat.com> <20160407003751.GA4459@flamenco> From: Paolo Bonzini Message-ID: <57061E6F.9000905@redhat.com> Date: Thu, 7 Apr 2016 10:46:39 +0200 MIME-Version: 1.0 In-Reply-To: <20160407003751.GA4459@flamenco> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 07/10] tb hash: hash phys_pc, pc, and flags with xxhash List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Emilio G. Cota" Cc: MTTCG Devel , Peter Maydell , Peter Crosthwaite , QEMU Developers , Sergey Fedorov , =?UTF-8?Q?Alex_Benn=c3=a9e?= , Richard Henderson On 07/04/2016 02:37, Emilio G. Cota wrote: > I take this back. I don't know anymore what I measured earlier today--it's > been a long day and was juggling quite a few things. > > I essentially see the same chain lengths (within 0.2%) for either function, i.e. > func3 or func5 with the padded 0's when running arm-softmmu. So this > is good news :> It's also much more reasonable for a good hash function .:) >> Perhaps better is to always use a three-word xxhash, but pick the 64-bit >> version if any of phys_pc and pc are 64-bits. The unrolling would be >> very effective, and the performance penalty not too important (64-bit on >> 32-bit is very slow anyway). > > By "the 64-bit version" you mean what I called func5? That is: > > if (sizeof(phys_pc) == sizeof(uint64_t) || sizeof(pc) == sizeof(uint64_t)) > return tb_hash_func5(); > return tb_hash_func3(); > > or do you mean xxhash64 (which I did not include in my patchset)? I meant xxhash64, but using func5 unconditionally is by far my preferred choice. Paolo