Re: [PATCH] KVM: avoid taking ioapic mutex for non-ioapic EOIs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/28/2009 10:37 PM, Marcelo Tosatti wrote:
On Mon, Dec 28, 2009 at 02:08:30PM +0200, Avi Kivity wrote:
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.
Can't you skip IOAPIC EOI for edge triggered interrupts (in the LAPIC
code), instead?

That's a lot cleaner, yes. Indeed there's the TMR which holds this info. Gleb suggested doing this in the local apic but we didn't think of using the TMR.

There's a small race there - the TMR is set after the IRR, so the interrupt can be injected and acked before the TMR is updated, but that can be fixed by switching the order.

But what about kvm_notify_acked_irq() in __kvm_ioapic_update_eoi()?

--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux