From: "Michael S. Tsirkin" <mst@redhat.com>
To: x86@kernel.org, kvm@vger.kernel.org
Cc: Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
gleb@redhat.com, Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: [PATCHv3 0/8] apic: eoi optimization support
Date: Tue, 15 May 2012 17:35:44 +0300 [thread overview]
Message-ID: <cover.1337091955.git.mst@redhat.com> (raw)
I'm looking at reducing the interrupt overhead for virtualized guests:
some workloads spend a large part of their time processing interrupts.
This patchset supplies infrastructure to reduce the IRQ ack overhead on
x86: the idea is to add an eoi_write callback that we can then optimize
without touching other apic functionality.
The main user is kvm: on kvm, an EOI write from the guest causes an
expensive exit to host; we can avoid this using shared memory as the
last patches in the series demonstrate.
But I also wrote a micro-optimized version for the regular x2apic: this
shaves off a branch and about 9 instructions from EOI when x2apic is
used, and a comment in ack_APIC_irq implies that someone counted
instructions there, at some point.
That's patch 4 in the series - if someone's unhappy with
this patch specifically this patch can be dropped
as nothing else in the series depends on it.
Also included in the patchset are a couple of trivial macro fixes.
The patches work fine on my boxes. See individual patches
for perf tests. You need to patch qemu to whitelist the kvm feature.
qemu patch will be sent as a reply to this mail.
The patches are against 3.4-rc7 - let me know if
I need to rebase.
Please review, and consider for linux 3.5.
Thanks,
MST
Changes from v2:
Kill guest with GP on an illegal MSR value
Add documentation
Changes from v1:
Add host side patch to series
Remove kvm-specific __test_and_clear_bit, document
that x86 one does what we want already
Clear msr on cpu unplug
Michael S. Tsirkin (8):
apic: fix typo EIO_ACK -> EOI_ACK and document
apic: use symbolic APIC_EOI_ACK
x86: add apic->eoi_write callback
x86: eoi micro-optimization
kvm_para: guest side for eoi avoidance
x86/bitops: note on __test_and_clear_bit atomicity
kvm: host side for eoi optimization
kvm: eoi msi documentation
Documentation/virtual/kvm/msr.txt | 32 +++++++++
arch/x86/include/asm/apic.h | 22 ++++++-
arch/x86/include/asm/apicdef.h | 2 +-
arch/x86/include/asm/bitops.h | 13 +++-
arch/x86/include/asm/kvm_host.h | 6 ++
arch/x86/include/asm/kvm_para.h | 2 +
arch/x86/kernel/apic/apic_flat_64.c | 2 +
arch/x86/kernel/apic/apic_noop.c | 1 +
arch/x86/kernel/apic/apic_numachip.c | 1 +
arch/x86/kernel/apic/bigsmp_32.c | 1 +
arch/x86/kernel/apic/es7000_32.c | 2 +
arch/x86/kernel/apic/numaq_32.c | 1 +
arch/x86/kernel/apic/probe_32.c | 1 +
arch/x86/kernel/apic/summit_32.c | 1 +
arch/x86/kernel/apic/x2apic_cluster.c | 1 +
arch/x86/kernel/apic/x2apic_phys.c | 1 +
arch/x86/kernel/apic/x2apic_uv_x.c | 1 +
arch/x86/kernel/kvm.c | 50 ++++++++++++++-
arch/x86/kvm/cpuid.c | 1 +
arch/x86/kvm/irq.c | 2 +-
arch/x86/kvm/lapic.c | 110 ++++++++++++++++++++++++++++++--
arch/x86/kvm/lapic.h | 2 +
arch/x86/kvm/trace.h | 34 ++++++++++
arch/x86/kvm/x86.c | 8 ++-
arch/x86/platform/visws/visws_quirks.c | 2 +-
25 files changed, 282 insertions(+), 17 deletions(-)
--
MST
next reply other threads:[~2012-05-15 14:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-15 14:35 Michael S. Tsirkin [this message]
2012-05-15 14:35 ` [PATCHv3 1/8] apic: fix typo EIO_ACK -> EOI_ACK and document Michael S. Tsirkin
2012-05-15 14:35 ` [PATCHv3 2/8] apic: use symbolic APIC_EOI_ACK Michael S. Tsirkin
2012-05-15 14:35 ` [PATCHv3 3/8] x86: add apic->eoi_write callback Michael S. Tsirkin
2012-05-15 14:36 ` [PATCHv3 4/8] x86: eoi micro-optimization Michael S. Tsirkin
2012-05-15 14:36 ` [PATCHv3 6/8] x86/bitops: note on __test_and_clear_bit atomicity Michael S. Tsirkin
2012-05-15 14:36 ` [PATCHv3 5/8] kvm_para: guest side for eoi avoidance Michael S. Tsirkin
2012-05-16 1:51 ` Marcelo Tosatti
2012-05-16 6:22 ` Michael S. Tsirkin
2012-05-15 14:36 ` [PATCHv3 7/8] kvm: host side for eoi optimization Michael S. Tsirkin
2012-05-16 1:55 ` Marcelo Tosatti
2012-05-16 6:16 ` Michael S. Tsirkin
2012-05-16 8:58 ` Michael S. Tsirkin
2012-05-15 14:36 ` [PATCHv3 8/8] kvm: eoi msi documentation Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1337091955.git.mst@redhat.com \
--to=mst@redhat.com \
--cc=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mtosatti@redhat.com \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox