From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org, kvm@vger.kernel.org, pbonzini@redhat.com,
gleb@redhat.com, mtosatti@redhat.com,
virtualization@lists.linux-foundation.org
Subject: [PATCH v2 0/6] kvm: pci PORT IO MMIO and PV MMIO speed tests
Date: Thu, 4 Apr 2013 13:39:57 +0300 [thread overview]
Message-ID: <cover.1365071407.git.mst@redhat.com> (raw)
These patches add a test device, useful to measure speed of MMIO versus PIO, in
different configurations. As I didn't want to reserve a hardcoded range
of memory, I added pci device for this instead. Used together with the
kvm unittest patches I posted on kvm mailing list.
To use, simply add the device on the pci bus.
Example test output:
vmcall 1519
....
outl_to_kernel 1745
....
mmio-no-eventfd:pci-mem 9075
mmio-wildcard-eventfd:pci-mem 3529
mmio-datamatch-eventfd:pci-mem 3509
mmio-pv-eventfd:pci-mem 1878
portio-no-eventfd:pci-io 5535
portio-wildcard-eventfd:pci-io 1846
portio-datamatch-eventfd:pci-io 1848
portio-pv-eventfd:pci-io 1842
First interesting conclusion is that the overhead of MMIO
exit to QEMU as compared to PIO is double that of
MMIO ioeventfd as compared to PIO eventfd. Is this a known fact?
Second is that PV MMIO is almost as fast as portio, so it
looks like a viable replacement when we have a lot of
devices such that we run out of IO space.
Third is that eventfd has small but measureable overhead,
and that hypercalls are measureably faster than port io.
The difference is probably in hardware. Whether this justifies
considering hypercalls for e.g. virtio, is open for discussion.
I also had to extend kvm in a minor way, making all ioeventfd
options accessible through the API. This actually needs less code
than checking that users DTRT.
Patches 1-5 are useful in themselves.
Patches 5 and 6 add support for PV MMIO eventfds and
add the test for it, tested against a kernel patch
I'll send shortly. They can be applied separately when
we are sure the kernel interface is going to be there.
Michael S. Tsirkin (6):
kvm: remove unused APIs
kvm: support any size for pio eventfd
kvm: support non datamatch ioeventfd
pci: add pci test device
kvm: add PV MMIO
pci-testdev: add pv mmio test
docs/specs/pci-testdev.txt | 26 ++++
hw/Makefile.objs | 1 +
hw/dataplane/hostmem.c | 1 +
hw/ivshmem.c | 2 +
hw/pci-testdev.c | 311 +++++++++++++++++++++++++++++++++++++++++++++
hw/pci/pci.h | 1 +
hw/vhost.c | 4 +-
hw/virtio-pci.c | 4 +-
include/exec/memory.h | 10 ++
include/sysemu/kvm.h | 4 -
kvm-all.c | 142 +++++++++++----------
kvm-stub.c | 10 --
linux-headers/linux/kvm.h | 8 ++
memory.c | 9 +-
14 files changed, 448 insertions(+), 85 deletions(-)
create mode 100644 docs/specs/pci-testdev.txt
create mode 100644 hw/pci-testdev.c
--
MST
next reply other threads:[~2013-04-04 10:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-04 10:39 Michael S. Tsirkin [this message]
2013-04-04 10:40 ` [PATCH v2 4/6] pci: add pci test device Michael S. Tsirkin
2013-04-04 10:40 ` [PATCH v2 1/6] kvm: remove unused APIs Michael S. Tsirkin
2013-04-04 10:40 ` [PATCH v2 2/6] kvm: support any size for pio eventfd Michael S. Tsirkin
2013-04-04 10:40 ` [PATCH v2 3/6] kvm: support non datamatch ioeventfd Michael S. Tsirkin
2013-04-04 10:40 ` [PATCH v2 6/6] pci-testdev: add pv mmio test Michael S. Tsirkin
2013-04-04 10:40 ` [PATCH v2 5/6] kvm: add PV MMIO Michael S. Tsirkin
2013-04-04 12:46 ` Paolo Bonzini
2013-04-04 13:10 ` Michael S. Tsirkin
2013-04-04 14:56 ` Paolo Bonzini
2013-04-04 14:38 ` Michael S. Tsirkin
2013-04-04 12:50 ` [Qemu-devel] " Peter Maydell
2013-04-04 13:11 ` Michael S. Tsirkin
2013-04-04 14:23 ` Peter Maydell
2013-04-04 13:34 ` 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.1365071407.git.mst@redhat.com \
--to=mst@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=virtualization@lists.linux-foundation.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