From: "Michael S. Tsirkin" <mst@redhat.com>
To: Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Alex Williamson <alex.williamson@redhat.com>
Subject: [PATCHv3 0/2] kvm: set irq affinity for assigned devices
Date: Fri, 13 Jan 2012 01:25:20 +0200 [thread overview]
Message-ID: <cover.1326410553.git.mst@redhat.com> (raw)
To forward an interrupt to a vcpu that runs on
a host cpu different from the current one,
we need an ipi which likely will cost us as much
as delivering the interrupt directly to that cpu would.
So it seems to make sense to set irq affinity hint to point there, irq
balancer can then take this into accound and balance interrupts
accordingly.
This is what this patchset does.
Note: it might make sense to optimize the gsi lookups
here for the msi case, using rcu, the way we did for eventfd.
But that's a subject for another patch.
Testing shows that with irqbalance running this performs basically the
same as manual numa pinning.
This patch applies to 3.2 or linux-next.
Changes from v1:
Address comments by Alex Williamson and Marcelo Tosatti:
- Fold in v2 patch from 20111017170440.GA8894@redhat.com:
fix affinity for lowest priority setups,
- Disable automatic affinity for round robin setups.
- Fix compiler warnings.
- Fix a checkpatch warning.
- Clear hint before free irq for MSI/INTx.
Michael S. Tsirkin (2):
kvm: pass host irq number to set irq calls
kvm: set affinity hint for assigned device msi
arch/x86/kvm/i8254.c | 4 ++--
arch/x86/kvm/lapic.c | 2 +-
arch/x86/kvm/x86.c | 2 +-
include/linux/kvm_host.h | 7 ++++---
virt/kvm/assigned-dev.c | 14 +++++++++-----
virt/kvm/eventfd.c | 7 ++++---
virt/kvm/ioapic.c | 2 +-
virt/kvm/ioapic.h | 2 +-
virt/kvm/irq_comm.c | 43 ++++++++++++++++++++++++++++++++++---------
9 files changed, 57 insertions(+), 26 deletions(-)
--
1.7.8.2.325.g247f9
next reply other threads:[~2012-01-12 23:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-12 23:25 Michael S. Tsirkin [this message]
2012-01-12 23:25 ` [PATCHv3 1/2] kvm: pass host irq number to set irq calls Michael S. Tsirkin
2012-01-12 23:25 ` [PATCHv3 2/2] kvm: set affinity hint for assigned device msi 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.1326410553.git.mst@redhat.com \
--to=mst@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=avi@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=tglx@linutronix.de \
--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 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.