aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-07-11 11:17:21 -0400
committerAvi Kivity <avi@qumranet.com>2007-10-13 04:18:20 -0400
commit15ad71460d75fd7ca41bb248a2310f3f39b302ba (patch)
tree1ea549e5c5629561c121a54def146fb6b706c2d4 /drivers/kvm/kvm.h
parent519ef35341b4f360f072ea74e398b70a5a2fc270 (diff)
KVM: Use the scheduler preemption notifiers to make kvm preemptible
Current kvm disables preemption while the new virtualization registers are in use. This of course is not very good for latency sensitive workloads (one use of virtualization is to offload user interface and other latency insensitive stuff to a container, so that it is easier to analyze the remaining workload). This patch re-enables preemption for kvm; preemption is now only disabled when switching the registers in and out, and during the switch to guest mode and back. Contains fixes from Shaohua Li <shaohua.li@intel.com>. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r--drivers/kvm/kvm.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index e92c84b04c1f..0667183ecbed 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -13,6 +13,7 @@
13#include <linux/signal.h> 13#include <linux/signal.h>
14#include <linux/sched.h> 14#include <linux/sched.h>
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/preempt.h>
16#include <asm/signal.h> 17#include <asm/signal.h>
17 18
18#include <linux/kvm.h> 19#include <linux/kvm.h>
@@ -301,6 +302,7 @@ void kvm_io_bus_register_dev(struct kvm_io_bus *bus,
301 302
302struct kvm_vcpu { 303struct kvm_vcpu {
303 struct kvm *kvm; 304 struct kvm *kvm;
305 struct preempt_notifier preempt_notifier;
304 int vcpu_id; 306 int vcpu_id;
305 struct mutex mutex; 307 struct mutex mutex;
306 int cpu; 308 int cpu;
@@ -429,7 +431,7 @@ struct kvm_arch_ops {
429 struct kvm_vcpu *(*vcpu_create)(struct kvm *kvm, unsigned id); 431 struct kvm_vcpu *(*vcpu_create)(struct kvm *kvm, unsigned id);
430 void (*vcpu_free)(struct kvm_vcpu *vcpu); 432 void (*vcpu_free)(struct kvm_vcpu *vcpu);
431 433
432 void (*vcpu_load)(struct kvm_vcpu *vcpu); 434 void (*vcpu_load)(struct kvm_vcpu *vcpu, int cpu);
433 void (*vcpu_put)(struct kvm_vcpu *vcpu); 435 void (*vcpu_put)(struct kvm_vcpu *vcpu);
434 void (*vcpu_decache)(struct kvm_vcpu *vcpu); 436 void (*vcpu_decache)(struct kvm_vcpu *vcpu);
435 437