[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 10/11] virtio: use VRingMemoryRegionCaches for d
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 10/11] virtio: use VRingMemoryRegionCaches for descriptor ring |
Date: |
Mon, 12 Dec 2016 16:06:15 +0000 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
On Mon, Dec 12, 2016 at 12:18:56PM +0100, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> hw/virtio/virtio.c | 22 ++++++++--------------
> 1 file changed, 8 insertions(+), 14 deletions(-)
>
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 4f355b4..702da0b 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -484,18 +484,16 @@ void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned
> int *in_bytes,
> unsigned int max, idx;
> unsigned int total_bufs, in_total, out_total;
> MemoryRegionCache *desc_cache = NULL;
> - MemoryRegionCache vring_desc_cache;
> MemoryRegionCache indirect_desc_cache;
> + VRingMemoryRegionCaches *caches;
> int64_t len = 0;
> int rc;
>
> rcu_read_lock();
> idx = vq->last_avail_idx;
> max = vq->vring.num;
> - len = address_space_cache_init(&vring_desc_cache, &address_space_memory,
> - vq->vring.desc, max * sizeof(VRingDesc),
> - false);
> - if (len < max * sizeof(VRingDesc)) {
> + caches = atomic_rcu_read(&vq->vring.caches);
Now the rcu_read_lock() above makes sense :).
Reviewed-by: Stefan Hajnoczi <address@hidden>
signature.asc
Description: PGP signature
- [Qemu-devel] [PATCH 01/11] exec: optimize remaining address_space_* cases, (continued)
- [Qemu-devel] [PATCH 01/11] exec: optimize remaining address_space_* cases, Paolo Bonzini, 2016/12/12
- [Qemu-devel] [PATCH 08/11] virtio: use MemoryRegionCache to access descriptors, Paolo Bonzini, 2016/12/12
- [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
- Re: [Qemu-devel] [PATCH 10/11] virtio: use VRingMemoryRegionCaches for descriptor ring,
Stefan Hajnoczi <=
- [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, 2016/12/13