All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv3 0/8] apic: eoi optimization support
@ 2012-05-15 14:35 Michael S. Tsirkin
  2012-05-15 14:35 ` [PATCHv3 1/8] apic: fix typo EIO_ACK -> EOI_ACK and document Michael S. Tsirkin
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Michael S. Tsirkin @ 2012-05-15 14:35 UTC (permalink / raw)
  To: x86, kvm
  Cc: Ingo Molnar, H. Peter Anvin, Avi Kivity, Marcelo Tosatti, gleb,
	Linus Torvalds, linux-kernel

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-05-16  8:58 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-15 14:35 [PATCHv3 0/8] apic: eoi optimization support Michael S. Tsirkin
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.