• Avi Kivity's avatar
    KVM: avoid taking ioapic mutex for non-ioapic EOIs · 46a929bc
    Avi Kivity authored
    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: default avatarAvi Kivity <avi@redhat.com>
    Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
    46a929bc
ioapic.c 10.4 KB