qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/6] kvm: pci PORT IO MMIO and PV MMIO speed tests
@ 2013-04-04 10:39 Michael S. Tsirkin
  2013-04-04 10:40 ` [Qemu-devel] [PATCH v2 4/6] pci: add pci test device Michael S. Tsirkin
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Michael S. Tsirkin @ 2013-04-04 10:39 UTC (permalink / raw)
  To: qemu-devel, kvm, pbonzini, gleb, mtosatti, virtualization

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

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

end of thread, other threads:[~2013-04-04 15:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-04 10:39 [Qemu-devel] [PATCH v2 0/6] kvm: pci PORT IO MMIO and PV MMIO speed tests Michael S. Tsirkin
2013-04-04 10:40 ` [Qemu-devel] [PATCH v2 4/6] pci: add pci test device Michael S. Tsirkin
2013-04-04 10:40 ` [Qemu-devel] [PATCH v2 1/6] kvm: remove unused APIs Michael S. Tsirkin
2013-04-04 10:40 ` [Qemu-devel] [PATCH v2 2/6] kvm: support any size for pio eventfd Michael S. Tsirkin
2013-04-04 10:40 ` [Qemu-devel] [PATCH v2 3/6] kvm: support non datamatch ioeventfd Michael S. Tsirkin
2013-04-04 10:40 ` [Qemu-devel] [PATCH v2 6/6] pci-testdev: add pv mmio test Michael S. Tsirkin
2013-04-04 10:40 ` [Qemu-devel] [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   ` 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

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).