From: David Hildenbrand Subject: Re: [PATCH 1/2] kvm: x86: export maximum number of mmu_page_hash collisions Date: Tue, 20 Dec 2016 10:58:40 +0100 Message-ID: References: <1482184705-127401-1-git-send-email-dmatlack@google.com> <91b68a42-5c38-9d22-89ae-4cc8c2ba4f1f@redhat.com> <80c3211c-e7c2-208d-cf8c-45925d9bcbf6@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: rkrcmar@redhat.com To: Paolo Bonzini , David Matlack , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:40934 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934458AbcLTJ6n (ORCPT ); Tue, 20 Dec 2016 04:58:43 -0500 In-Reply-To: <80c3211c-e7c2-208d-cf8c-45925d9bcbf6@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Am 20.12.2016 um 10:55 schrieb Paolo Bonzini: > > > On 20/12/2016 10:48, David Hildenbrand wrote: >>> >>> __clear_sp_write_flooding_count(sp); >>> - trace_kvm_mmu_get_page(sp, false); >>> - return sp; >>> + created = false; >> >> Simply doing >> >> if (collisions > vcpu->kvm->stat.max_mmu_page_hash_collisions) >> vcpu->kvm->stat.max_mmu_page_hash_collisions = collisions; >> >> at this point saves a local variable, a jump label and keeps this patch >> minimal. > > How so? There is a "break" above. > Keeping the same at the end of the function / (even better directly after the for loop) of course. > Paolo > -- David