qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 00/11] speedup vring processing with MemoryRegionCaches
@ 2016-12-12 11:18 Paolo Bonzini
  2016-12-12 11:18 ` [Qemu-devel] [PATCH 01/11] exec: optimize remaining address_space_* cases Paolo Bonzini
                   ` (12 more replies)
  0 siblings, 13 replies; 27+ messages in thread
From: Paolo Bonzini @ 2016-12-12 11:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, famz, mst, borntraeger

It is known that virtio's usage of ld_*_phys and st_*_phys functions
wastes time in address_space_translate, visiting the
AddressSpaceDispatch's radix tree.

This series introduces a small cache that changes these functions
to a simple range check and memory access.  The effect is a bit
underwhelming, because the improvement is only 1-2Kiops/second.
Nevertheless I'm throwing out the patches so that for example they
can be tested on s390.

Things to fix: handle address_space_cache_init failures
in virtio_init_region_cache.  Also, once virtio breaks free of
address_space_memoory, we'll need to handle invalidation in IOMMU regions.
For the latter, maybe it's worth introducing a new abstraction that
is higher-level than MemoryListener and covers both regular and IOMMU
memory regions.

Paolo

Paolo Bonzini (11):
  exec: optimize remaining address_space_* cases
  exec: introduce memory_ldst.inc.c
  exec: introduce address_space_extend_translation
  exec: introduce MemoryRegionCache
  virtio: make virtio_should_notify static
  virtio: add virtio_*_phys_cached
  virtio: use address_space_map/unmap to access descriptors
  virtio: use MemoryRegionCache to access descriptors
  virtio: add MemoryListener to cache ring translations
  virtio: use VRingMemoryRegionCaches for descriptor ring
  virtio: use VRingMemoryRegionCaches for avail and used rings

 exec.c                            | 687 +++++-------------------------------
 hw/net/virtio-net.c               |  14 +-
 hw/virtio/virtio.c                | 322 +++++++++++++----
 include/exec/cpu-all.h            |  23 ++
 include/exec/cpu-common.h         |  15 -
 include/exec/memory.h             | 166 +++++++++
 include/hw/virtio/virtio-access.h |  52 +++
 include/hw/virtio/virtio.h        |   2 +-
 include/qemu/typedefs.h           |   1 +
 memory_ldst.inc.c                 | 709 ++++++++++++++++++++++++++++++++++++++
 10 files changed, 1316 insertions(+), 675 deletions(-)
 create mode 100644 memory_ldst.inc.c

-- 
1.8.3.1

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

end of thread, other threads:[~2016-12-13 13:15 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-12 11:18 [Qemu-devel] [RFC PATCH 00/11] speedup vring processing with MemoryRegionCaches Paolo Bonzini
2016-12-12 11:18 ` [Qemu-devel] [PATCH 01/11] exec: optimize remaining address_space_* cases Paolo Bonzini
2016-12-12 13:27   ` Stefan Hajnoczi
2016-12-12 11:18 ` [Qemu-devel] [PATCH 02/11] exec: introduce memory_ldst.inc.c Paolo Bonzini
2016-12-12 13:44   ` Stefan Hajnoczi
2016-12-12 11:18 ` [Qemu-devel] [PATCH 03/11] exec: introduce address_space_extend_translation Paolo Bonzini
2016-12-12 13:47   ` Stefan Hajnoczi
2016-12-12 11:18 ` [Qemu-devel] [PATCH 04/11] exec: introduce MemoryRegionCache Paolo Bonzini
2016-12-12 14:06   ` Stefan Hajnoczi
2016-12-13 13:14     ` Paolo Bonzini
2016-12-12 11:18 ` [Qemu-devel] [PATCH 05/11] virtio: make virtio_should_notify static Paolo Bonzini
2016-12-12 14:07   ` Stefan Hajnoczi
2016-12-12 11:18 ` [Qemu-devel] [PATCH 06/11] virtio: add virtio_*_phys_cached Paolo Bonzini
2016-12-12 14:08   ` Stefan Hajnoczi
2016-12-12 11:18 ` [Qemu-devel] [PATCH 07/11] virtio: use address_space_map/unmap to access descriptors Paolo Bonzini
2016-12-12 14:12   ` Stefan Hajnoczi
2016-12-12 11:18 ` [Qemu-devel] [PATCH 08/11] virtio: use MemoryRegionCache " Paolo Bonzini
2016-12-12 14:17   ` Stefan Hajnoczi
2016-12-13 11:14     ` Paolo Bonzini
2016-12-12 11:18 ` [Qemu-devel] [PATCH 09/11] virtio: add MemoryListener to cache ring translations Paolo Bonzini
2016-12-12 14:24   ` Stefan Hajnoczi
2016-12-12 11:18 ` [Qemu-devel] [PATCH 10/11] virtio: use VRingMemoryRegionCaches for descriptor ring Paolo Bonzini
2016-12-12 16:06   ` Stefan Hajnoczi
2016-12-12 11:18 ` [Qemu-devel] [PATCH 11/11] virtio: use VRingMemoryRegionCaches for avail and used rings Paolo Bonzini
2016-12-12 16:08   ` Stefan Hajnoczi
2016-12-12 16:11 ` [Qemu-devel] [RFC PATCH 00/11] speedup vring processing with MemoryRegionCaches Stefan Hajnoczi
2016-12-13 12:56 ` Christian Borntraeger

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