[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 00/11] speedup vring processing with MemoryR
From: |
Christian Borntraeger |
Subject: |
Re: [Qemu-devel] [RFC PATCH 00/11] speedup vring processing with MemoryRegionCaches |
Date: |
Tue, 13 Dec 2016 13:56:00 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
On 12/12/2016 12:18 PM, Paolo Bonzini wrote:
> 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.
It does seem to save some cpu cycles and by that it gives some benefit
if you are cpu bound (e.g. with just one host CPU I get ~4% benefit in
terms of throughput)
>
> 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
>
- Re: [Qemu-devel] [PATCH 08/11] virtio: use MemoryRegionCache to access descriptors, (continued)
- [Qemu-devel] [PATCH 02/11] exec: introduce memory_ldst.inc.c, Paolo Bonzini, 2016/12/12
- [Qemu-devel] [PATCH 09/11] virtio: add MemoryListener to cache ring translations, Paolo Bonzini, 2016/12/12
- [Qemu-devel] [PATCH 10/11] virtio: use VRingMemoryRegionCaches for descriptor ring, Paolo Bonzini, 2016/12/12
- [Qemu-devel] [PATCH 11/11] virtio: use VRingMemoryRegionCaches for avail and used rings, Paolo Bonzini, 2016/12/12
- Re: [Qemu-devel] [RFC PATCH 00/11] speedup vring processing with MemoryRegionCaches, Stefan Hajnoczi, 2016/12/12
- Re: [Qemu-devel] [RFC PATCH 00/11] speedup vring processing with MemoryRegionCaches,
Christian Borntraeger <=