From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atf5B-00087L-TW for qemu-devel@nongnu.org; Fri, 22 Apr 2016 13:41:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1atf58-00061W-1d for qemu-devel@nongnu.org; Fri, 22 Apr 2016 13:41:33 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:36378) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atf57-00061S-T3 for qemu-devel@nongnu.org; Fri, 22 Apr 2016 13:41:29 -0400 Received: by mail-qk0-x243.google.com with SMTP id l68so6252658qkf.3 for ; Fri, 22 Apr 2016 10:41:29 -0700 (PDT) Sender: Richard Henderson References: <1461107270-19234-1-git-send-email-cota@braap.org> <1461107270-19234-12-git-send-email-cota@braap.org> From: Richard Henderson Message-ID: <571A6245.4070209@twiddle.net> Date: Fri, 22 Apr 2016 10:41:25 -0700 MIME-Version: 1.0 In-Reply-To: <1461107270-19234-12-git-send-email-cota@braap.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 11/11] translate-all: add tb hash bucket info to 'info jit' dump List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Emilio G. Cota" , QEMU Developers , MTTCG Devel Cc: =?UTF-8?Q?Alex_Benn=c3=a9e?= , Paolo Bonzini , Peter Crosthwaite , Peter Maydell , Sergey Fedorov On 04/19/2016 04:07 PM, Emilio G. Cota wrote: > + ht_avg_len = qht_avg_bucket_chain_length(&tcg_ctx.tb_ctx.htable, &ht_heads); > + cpu_fprintf(f, "TB hash avg chain %0.5f buckets\n", ht_avg_len); > + cpu_fprintf(f, "TB hash size %zu head buckets\n", ht_heads); I think the accounting is questionable here. Consider the following data: TB count 230467/671088 TB invalidate count 25915 TB hash avg chain 1.03073 buckets TB hash size 131072 head buckets This means that we've got 230467 - 25915 = 204552 active TB's, installed into a hash table with 131072 heads. For a perfectly uniform distribution of TBs, that would be an average chain length of 204552 / 131072 = 1.56. In order to get the average down to 1.03, there need to be a substantial number of heads with zero entries. I think perhaps it might be more enlightening to separately account for empty and non-empty heads. E.g. TB hash buckets used xxxx/131072 TB hash avg chain yyyy where xxxx is the number of non-empty heads, and yyyy = |TBs| / xxxx. I also wonder if it wouldn't be better to size the hash table as appropriate for the maximum number of allowable TBs. r~