public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* non-root mode and preemption
@ 2016-06-13 10:06 Oscar Fernando Garcia
  2016-06-13 13:45 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Oscar Fernando Garcia @ 2016-06-13 10:06 UTC (permalink / raw)
  To: kvm

Good Morning,

I have a simple question. In KVM code: /arch/x86/kvm/x86.c when the 
function vcpu_enter_guest is called, the run function ( 
kvm_x86_ops->run(vcpu)) is called with preemption and irqs disabled.
My question is, running in non-root mode with preemption and irqs 
disabled affects the latency of other processes or VPCUs running in the 
same CPU?


Thank you

Oscar

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: non-root mode and preemption
  2016-06-13 10:06 non-root mode and preemption Oscar Fernando Garcia
@ 2016-06-13 13:45 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2016-06-13 13:45 UTC (permalink / raw)
  To: Oscar Fernando Garcia, kvm

On 13/06/2016 12:06, Oscar Fernando Garcia wrote:
> Good Morning,
> 
> I have a simple question. In KVM code: /arch/x86/kvm/x86.c when the
> function vcpu_enter_guest is called, the run function (
> kvm_x86_ops->run(vcpu)) is called with preemption and irqs disabled.
> My question is, running in non-root mode with preemption and irqs
> disabled affects the latency of other processes or VPCUs running in the
> same CPU?

Even though kvm_x86_ops->run itself is called with interrupts disabled,
interrupts are enabled while the guest runs.  Instead of being serviced
immediately by the processor, however, they cause a vmexit.  The
interrupt routine is then called during
kvm_x86_ops->handle_external_intr, and preemption is enabled again soon
after that in vcpu_enter_guest.

The extra latency introduced by KVM is very low, around 1000 clock
cycles or less than a microsecond.

Paolo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-13 13:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-13 10:06 non-root mode and preemption Oscar Fernando Garcia
2016-06-13 13:45 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox