summaryrefslogtreecommitdiff
path: root/virt/kvm/ioapic.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-12-28 12:08:30 (GMT)
committerMarcelo Tosatti <mtosatti@redhat.com>2010-03-01 15:35:46 (GMT)
commit46a929bc15fcd48e1e0e770a44040a6949cae133 (patch)
tree5351d75586821e74d82c59f1e1cde10806a25237 /virt/kvm/ioapic.h
parentf4c9e87c83a9f5bc1800db27dbb39e5cd1254c0a (diff)
downloadlinux-fsl-qoriq-46a929bc15fcd48e1e0e770a44040a6949cae133.tar.xz
KVM: avoid taking ioapic mutex for non-ioapic EOIs
When the guest acknowledges an interrupt, it sends an EOI message to the local apic, which broadcasts it to the ioapic. To handle the EOI, we need to take the ioapic mutex. On large guests, this causes a lot of contention on this mutex. Since large guests usually don't route interrupts via the ioapic (they use msi instead), this is completely unnecessary. Avoid taking the mutex by introducing a handled_vectors bitmap. Before taking the mutex, check if the ioapic was actually responsible for the acked vector. If not, we can return early. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm/ioapic.h')
-rw-r--r--virt/kvm/ioapic.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/virt/kvm/ioapic.h b/virt/kvm/ioapic.h
index 419c43b..a505ce9 100644
--- a/virt/kvm/ioapic.h
+++ b/virt/kvm/ioapic.h
@@ -46,6 +46,7 @@ struct kvm_ioapic {
struct kvm *kvm;
void (*ack_notifier)(void *opaque, int irq);
struct mutex lock;
+ DECLARE_BITMAP(handled_vectors, 256);
};
#ifdef DEBUG