aboutsummaryrefslogtreecommitdiff
path: root/drivers/kvm/kvm.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-04-19 17:27:43 +0300
committerAvi Kivity <avi@qumranet.com>2007-05-03 10:52:30 +0300
commit1165f5fec18c077bdba88e7125fd41f8e3617cb4 (patch)
treea1931bfddfabaa909f4ebd14a5c00a549d1e37ec /drivers/kvm/kvm.h
parent3fca03653010b8c5fa63b99fc94c78cbfb433d00 (diff)
KVM: Per-vcpu statistics
Make the exit statistics per-vcpu instead of global. This gives a 3.5% boost when running one virtual machine per core on my two socket dual core (4 cores total) machine. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r--drivers/kvm/kvm.h35
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index b9c318a9e33..d1a90c5d76c 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -236,6 +236,22 @@ struct kvm_pio_request {
int rep;
};
+struct kvm_stat {
+ u32 pf_fixed;
+ u32 pf_guest;
+ u32 tlb_flush;
+ u32 invlpg;
+
+ u32 exits;
+ u32 io_exits;
+ u32 mmio_exits;
+ u32 signal_exits;
+ u32 irq_window_exits;
+ u32 halt_exits;
+ u32 request_irq_exits;
+ u32 irq_exits;
+};
+
struct kvm_vcpu {
struct kvm *kvm;
union {
@@ -298,6 +314,8 @@ struct kvm_vcpu {
int sigset_active;
sigset_t sigset;
+ struct kvm_stat stat;
+
struct {
int active;
u8 save_iopl;
@@ -347,22 +365,6 @@ struct kvm {
struct file *filp;
};
-struct kvm_stat {
- u32 pf_fixed;
- u32 pf_guest;
- u32 tlb_flush;
- u32 invlpg;
-
- u32 exits;
- u32 io_exits;
- u32 mmio_exits;
- u32 signal_exits;
- u32 irq_window_exits;
- u32 halt_exits;
- u32 request_irq_exits;
- u32 irq_exits;
-};
-
struct descriptor_table {
u16 limit;
unsigned long base;
@@ -424,7 +426,6 @@ struct kvm_arch_ops {
unsigned char *hypercall_addr);
};
-extern struct kvm_stat kvm_stat;
extern struct kvm_arch_ops *kvm_arch_ops;
#define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt)