Re: [PATCH 1/2] kvm: x86: export maximum number of mmu_page_hash collisions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 20/12/2016 10:58, David Hildenbrand wrote:
> 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.

Then the question is whether a goto is better or worse than code
duplication.  Here I don't see the point in introducing the created bool
and factoring the call to trace_kvm_mmu_get_page, but on the other hand
a single "out" label makes sense.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux