]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
KVM: optimize ISR lookups
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 24 Jun 2012 16:24:26 +0000 (19:24 +0300)
committerAvi Kivity <avi@redhat.com>
Mon, 25 Jun 2012 09:37:21 +0000 (12:37 +0300)
commit8680b94b0e6046af2644c17313287ec0cb5843dc
treef86463519e93140de7e113dc4dfa88a8cc348c6a
parent5eadf916dfa04c3c51397dbcb803ce8735bf191a
KVM: optimize ISR lookups

We perform ISR lookups twice: during interrupt
injection and on EOI. Typical workloads only have
a single bit set there. So we can avoid ISR scans by
1. counting bits as we set/clear them in ISR
2. on set, caching the injected vector number
3. on clear, invalidating the cache

The real purpose of this is enabling PV EOI
which needs to quickly validate the vector.
But non PV guests also benefit: with this patch,
and without interrupt nesting, apic_find_highest_isr
will always return immediately without scanning ISR.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/lapic.c
arch/x86/kvm/lapic.h