linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@ozlabs.org>
To: kvm@vger.kernel.org, linuxppc-dev@ozlabs.org
Cc: kvm-ppc@vger.kernel.org
Subject: Re: [PATCH 00/13] Real-mode acceleration of device interrupts in HV KVM
Date: Mon, 12 Sep 2016 10:55:13 +1000	[thread overview]
Message-ID: <20160912005513.GD9873@fergus.ozlabs.ibm.com> (raw)
In-Reply-To: <1471584957-21484-1-git-send-email-paulus@ozlabs.org>

On Fri, Aug 19, 2016 at 03:35:44PM +1000, Paul Mackerras wrote:
> This patch set reduces the latency for presenting interrupts from PCI
> pass-through devices to a Book3S HV guest.  Currently, if an interrupt
> arrives from a PCI pass-through device while a guest is running, it
> causes an exit of all threads on the core to the host, where the
> interrupt is handled by making an interrupt pending in the virtual
> XICS interrupt controller for the guest that owns the device.
> Furthermore, there is currently no attempt to direct PCI pass-through
> device interrupts to the physical core where the VCPU that they are
> directed to is running, so they often land on a different core and
> require an IPI to interrupt the VCPU.
> 
> With this patch set, if the interrupt arrives on a core where the
> correct guest is running, it can be handled in hypervisor real mode
> without needing an exit to host context.  If the destination VCPU is
> on the same core, then we can interrupt it using at most a msgsnd
> (message send) instruction, which is considerably faster than an IPI.
> 
> Further, if an interrupt arrives on a different core, we then change
> the destination for the interrupt in the physical interrupt controller
> to point to the core where the VCPU is running.  For now, we always
> direct the interrupt to thread 0 of the core because the other threads
> are offline from the point of view of the host, and the offline loop
> (which is where those other threads run when thread 0 is in host
> context) doesn't handle device interrupts.
> 
> This patch set is based on a patch set from Suresh Warrier, with
> considerable revision by me.  The data structure for mapping host
> interrupt numbers to guest interrupt numbers is just a flat array that
> is searched linearly, which works and is simple but could perform
> poorly with large numbers of interrupt sources.  It would be simple to
> replace this mapping array with a more sophisticated data structure in
> future.
> 
> To test the performance of this patch set, I used a network one-byte
> ping-pong test between a guest with a Mellanox CX-3 passed through to
> it, connected over 10Gb ethernet to another POWER8 system running
> bare-metal with a Chelsio 10Gb ethernet adapter.  (The guest was
> running Ubuntu 16.04.1 under QEMU v2.7-rc2 on a POWER8.)  Without this
> patchset, the round-trip latency was 43us, and with it the latency was
> 41us, a saving of 2us per round-trip.

Series applied to my kvm-ppc-next branch.

Paul.

      parent reply	other threads:[~2016-09-12  0:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-19  5:35 [PATCH 00/13] Real-mode acceleration of device interrupts in HV KVM Paul Mackerras
2016-08-19  5:35 ` [PATCH 01/13] powerpc: Add simple cache inhibited MMIO accessors Paul Mackerras
2016-08-19  5:35 ` [PATCH 02/13] KVM: PPC: Book3S HV: Convert kvmppc_read_intr to a C function Paul Mackerras
2016-08-19  5:35 ` [PATCH 03/13] KVM: PPC: select IRQ_BYPASS_MANAGER Paul Mackerras
2016-08-19  5:35 ` [PATCH 04/13] KVM: PPC: Book3S HV: Introduce kvmppc_passthru_irqmap Paul Mackerras
2016-08-19  5:35 ` [PATCH 05/13] powerpc/powernv: Provide facilities for EOI, usable from real mode Paul Mackerras
2016-08-19  5:35 ` [PATCH 06/13] KVM: PPC: Book3S HV: Enable IRQ bypass Paul Mackerras
2016-08-19  5:35 ` [PATCH 07/13] KVM: PPC: Book3S HV: Handle passthrough interrupts in guest Paul Mackerras
2016-09-12  0:53   ` [PATCH v2 " Paul Mackerras
2016-08-19  5:35 ` [PATCH 08/13] KVM: PPC: Book3S HV: Complete passthrough interrupt in host Paul Mackerras
2016-08-19  5:35 ` [PATCH 09/13] KVM: PPC: Book3S HV: Dump irqmap in debugfs Paul Mackerras
2016-08-19  5:35 ` [PATCH 10/13] KVM: PPC: Book3S HV: Tunable to disable KVM IRQ bypass Paul Mackerras
2016-08-19  5:35 ` [PATCH 11/13] KVM: PPC: Book3S HV: Update irq stats for IRQs handled in real mode Paul Mackerras
2016-08-19  5:35 ` [PATCH 12/13] KVM: PPC: Book3S HV: Set server for passed-through interrupts Paul Mackerras
2016-08-19  5:35 ` [PATCH 13/13] KVM: PPC: Book3S HV: Counters for passthrough IRQ stats Paul Mackerras
2016-09-12  0:55 ` Paul Mackerras [this message]

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=20160912005513.GD9873@fergus.ozlabs.ibm.com \
    --to=paulus@ozlabs.org \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).