diff options
author | Avi Kivity <avi@qumranet.com> | 2007-02-21 11:04:26 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-03-04 04:12:42 -0500 |
commit | bccf2150fe62dda5fb09efa2f64d2a234694eb48 (patch) | |
tree | b5e6fc6440b864ddd1c32c4cee1916a0c5484c63 /drivers/kvm/kvm.h | |
parent | c5ea76600653b1a242321734435cb1c54778941a (diff) |
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>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r-- | drivers/kvm/kvm.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 41cc27de4d66..0d122bf889db 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h | |||
@@ -309,6 +309,7 @@ struct kvm { | |||
309 | int busy; | 309 | int busy; |
310 | unsigned long rmap_overflow; | 310 | unsigned long rmap_overflow; |
311 | struct list_head vm_list; | 311 | struct list_head vm_list; |
312 | struct file *filp; | ||
312 | }; | 313 | }; |
313 | 314 | ||
314 | struct kvm_stat { | 315 | struct kvm_stat { |
@@ -343,7 +344,7 @@ struct kvm_arch_ops { | |||
343 | int (*vcpu_create)(struct kvm_vcpu *vcpu); | 344 | int (*vcpu_create)(struct kvm_vcpu *vcpu); |
344 | void (*vcpu_free)(struct kvm_vcpu *vcpu); | 345 | void (*vcpu_free)(struct kvm_vcpu *vcpu); |
345 | 346 | ||
346 | struct kvm_vcpu *(*vcpu_load)(struct kvm_vcpu *vcpu); | 347 | void (*vcpu_load)(struct kvm_vcpu *vcpu); |
347 | void (*vcpu_put)(struct kvm_vcpu *vcpu); | 348 | void (*vcpu_put)(struct kvm_vcpu *vcpu); |
348 | void (*vcpu_decache)(struct kvm_vcpu *vcpu); | 349 | void (*vcpu_decache)(struct kvm_vcpu *vcpu); |
349 | 350 | ||