Re: [PATCH v2] KVM: x86: add paging gcc optimization

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

 



On 08/03/12 12:45, Davidlohr Bueso wrote:
> From: Davidlohr Bueso <dave@xxxxxxx>
> 
> Since most guests will have paging enabled for memory management, add likely() optimization
> around CR0.PG checks.

>  {
> -	return kvm_read_cr0_bits(vcpu, X86_CR0_PG);
> +	return likely(kvm_read_cr0_bits(vcpu, X86_CR0_PG));


IMHO likely/unlikely should be considered more as fast-path/slow-path and not as often/less often.
Is that the case here? This patch  might cause a mis-prediction for non-paging guests all 
the time. 

Non-paging might be really irrelevant, so I am just making a point, since
likely/unlikely is mis-used too often especially for "most users do it that way".


Christian

--
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