Re: [PATCH RFC 1/2] KVM: don't check for PF_VCPU when yielding

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

 



> Applied with a rewritten commit message:
> 
> KVM: don't check for PF_VCPU when yielding
> 
> kvm_enter_guest() has to be called with preemption disabled and will
> set PF_VCPU.  Current code takes PF_VCPU as a hint that the VCPU thread
> is running and therefore needs no yield.
> 
> However, the check on PF_VCPU is wrong on s390, where preemption
> has to stay enabled on s390 in order to correctly process page faults.
> Thus, s390 reenables preemption and starts to execute the guest.
> The thread might be scheduled out between kvm_enter_guest() and
> kvm_exit_guest(), resulting in PF_VCPU being set but not being run.
> When this happens, the opportunity for directed yield is missed.
> 
> However, this check is done already in kvm_vcpu_on_spin before calling
> kvm_vcpu_yield_loop:
> 
>         if (!ACCESS_ONCE(vcpu->preempted))
>                 continue;
> 
> so the check on PF_VCPU is superfluous in general, and this patch 
> removes it.
> 
> Signed-off-by: David Hildenbrand <dahi@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> 

Perfect, thanks!

David

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