]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Per-vcpu inodes
authorAvi Kivity <avi@qumranet.com>
Wed, 21 Feb 2007 16:04:26 +0000 (18:04 +0200)
committerAvi Kivity <avi@qumranet.com>
Sun, 4 Mar 2007 09:12:42 +0000 (11:12 +0200)
commitaed3a4ee8ab8ba59b25f1724a65b28b46eaca04b
treeb5e6fc6440b864ddd1c32c4cee1916a0c5484c63
parent5224af89968e6232816f02bf29b0a6d94c1bd799
KVM: Per-vcpu inodes

Allocate a distinct inode for every vcpu in a VM.  This has the following
benefits:

 - the filp cachelines are no longer bounced when f_count is incremented on
   every ioctl()
 - the API and internal code are distinctly clearer; for example, on the
   KVM_GET_REGS ioctl, there is no need to copy the vcpu number from
   userspace and then copy the registers back; the vcpu identity is derived
   from the fd used to make the call

Right now the performance benefits are completely theoretical since (a) we
don't support more than one vcpu per VM and (b) virtualization hardware
inefficiencies completely everwhelm any cacheline bouncing effects.  But
both of these will change, and we need to prepare the API today.

Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/kvm.h
drivers/kvm/kvm_main.c
drivers/kvm/svm.c
drivers/kvm/vmx.c
include/linux/kvm.h