From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2qU7-0005sS-67 for qemu-devel@nongnu.org; Tue, 17 May 2016 21:41:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2kNH-0004cg-UH for qemu-devel@nongnu.org; Tue, 17 May 2016 15:09:51 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:37988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2kNF-0004b5-HU for qemu-devel@nongnu.org; Tue, 17 May 2016 15:09:47 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E7F3920CDD for ; Tue, 17 May 2016 15:09:31 -0400 (EDT) Date: Tue, 17 May 2016 15:09:31 -0400 From: "Emilio G. Cota" Message-ID: <20160517190931.GA30174@flamenco> References: <1463196873-17737-1-git-send-email-cota@braap.org> <1463196873-17737-10-git-send-email-cota@braap.org> <573B5948.2060702@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <573B5948.2060702@gmail.com> Subject: Re: [Qemu-devel] [PATCH v5 09/18] tb hash: hash phys_pc, pc, and flags with xxhash List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Fedorov Cc: QEMU Developers , MTTCG Devel , Alex =?iso-8859-1?Q?Benn=E9e?= , Paolo Bonzini , Peter Crosthwaite , Richard Henderson On Tue, May 17, 2016 at 20:47:52 +0300, Sergey Fedorov wrote: > On 14/05/16 06:34, Emilio G. Cota wrote: > > For some workloads such as arm bootup, tb_phys_hash is performance-critical. > > The is due to the high frequency of accesses to the hash table, originated > > by (frequent) TLB flushes that wipe out the cpu-private tb_jmp_cache's. > > More info: > > https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg05098.html > > > > To dig further into this I modified an arm image booting debian jessie to > > immediately shut down after boot. Analysis revealed that quite a bit of time > > is unnecessarily spent in tb_phys_hash: the cause is poor hashing that > > results in very uneven loading of chains in the hash table's buckets; > > the longest observed chain had ~550 elements. > > > > The appended addresses this with two changes: > > Does "the appended" means "this patch"? Sorry, I've just never seen such > expression before... Yes, in this context a patch is _appended_ to the (long-ish) discussion. (snip) > > -static inline unsigned int tb_phys_hash_func(tb_page_addr_t pc) > > +static inline > > +uint32_t tb_hash_func(tb_page_addr_t phys_pc, target_ulong pc, int flags) > > Nitpicking: now 'flags' is of uint32_t type. I've changed this in my tree -- thanks! Emilio