FW: Event channels in KVM?

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

 



Anthony Liguori <anthony <at> codemonkey.ws> writes:
> 
> Kapadia, Vivek wrote:
> > I came across this thread looking for an efficient event channel
> > mechanism between two guests (running on different cpu cores).
> >
> > While I can use available emulated IO mechanism (guest1->host kernel 
> > driver->Qemu1->Qemu2) in conjunction with interrupt mechanism (Qemu2 
> > ->host kernel driver->guest2) in KVM, this involves
> > several context switches. Xen handles notifications in hypervisor via 
> > hypercall and hence is likely more efficient.
> >   
> 
> They almost certainly aren't more efficient.

> 
> An event channel notification involves a hypercall to the hypervisor.  
> When using VT, the performance difference between a vmcall exit vs. a 
> pio exit is quite small (especially compared to the overhead of the 
> exit).  We're talking in the order of nanoseconds compared to 
> microseconds.


I agree. The hypercall and PIO exit won't be significantly different, but what I am referring to here is a particular case of guest to guest notification and number of context switches involved in the process. While I cannot avoid heavy weight exit either way (exit via hypercall or PIO), by handling the notification in hypervisor, I would think we can reduce the overhead due to extra the context switches.

> What makes KVM particularly different from Xen is that in KVM, the PIO 
> operation results in a direct transition to QEMU.  In Xen, typically 
> event channel notifications result in a bit being set in a bitmap which 
> then results in an interrupt injection depending on the next opportunity 
> the hypervisor has to schedule/run the receiving domain.  This is not 
> deterministic and can potentially be a very long period of time.
> 

I have guests pinned to cpu cores, and hence the notifications will be synchronous.

> 
> > Is there a way I can perform direct notification (guest1->host kernel 
> > driver->guest2) in kvm?
> >   
> 
> Between guests, we don't have a notification framework today.  You can 
> use IPC from two QEMU processes and I'd expect that to perform pretty 
> well.  I'm not sure you can get much advantages from doing things in the 
> kernel because you cannot avoid the heavy weight exit.
> 

Has KVM future plans to support guest-to-guest notification framework? 
If not, how easy or difficult would it be today to write simple guest-to-guest notification in KVM host driver? Any hints would be helpful.
Thanks.


> Regards,
> 
> Anthony Liguori
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo <at> vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 




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