diff options
author | Eddie Dong <eddie.dong@intel.com> | 2007-09-03 09:15:12 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-10-13 04:18:26 -0400 |
commit | a3d7f85f471f889e4477863a7ca42828ae74e77d (patch) | |
tree | f75148a940f7e297da91f6a14ab573291ceb050f /drivers/kvm/lapic.c | |
parent | 1b9778dae71dc64d3678d766c0f1fbed79c80f9f (diff) |
KVM: Migrate lapic hrtimer when vcpu moves to another cpu
This reduces overhead by accessing cachelines from the wrong node, as well
as simplifying locking.
[Qing: fix for inactive or expired one-shot timer]
Signed-off-by: Yaozu (Eddie) Dong <Eddie.Dong@intel.com>
Signed-off-by: Qing He <qing.he@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/lapic.c')
-rw-r--r-- | drivers/kvm/lapic.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/kvm/lapic.c b/drivers/kvm/lapic.c index 490d4939dba7..2706ec36c258 100644 --- a/drivers/kvm/lapic.c +++ b/drivers/kvm/lapic.c | |||
@@ -979,3 +979,17 @@ void kvm_apic_post_state_restore(struct kvm_vcpu *vcpu) | |||
979 | update_divide_count(apic); | 979 | update_divide_count(apic); |
980 | start_apic_timer(apic); | 980 | start_apic_timer(apic); |
981 | } | 981 | } |
982 | |||
983 | void kvm_migrate_apic_timer(struct kvm_vcpu *vcpu) | ||
984 | { | ||
985 | struct kvm_lapic *apic = vcpu->apic; | ||
986 | struct hrtimer *timer; | ||
987 | |||
988 | if (!apic) | ||
989 | return; | ||
990 | |||
991 | timer = &apic->timer.dev; | ||
992 | if (hrtimer_cancel(timer)) | ||
993 | hrtimer_start(timer, timer->expires, HRTIMER_MODE_ABS); | ||
994 | } | ||
995 | EXPORT_SYMBOL_GPL(kvm_migrate_apic_timer); | ||