qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] dataplane: change vring API to use VirtQueu


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 2/2] dataplane: change vring API to use VirtQueueElement
Date: Mon, 13 May 2013 13:48:50 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, May 10, 2013 at 02:27:29PM +0200, Paolo Bonzini wrote:
> @@ -305,29 +285,28 @@ static void handle_notify(EventNotifier *e)
>          vring_disable_notification(s->vdev, &s->vring);
>  
>          for (;;) {
> -            head = vring_pop(s->vdev, &s->vring, iov, end, &out_num, 
> &in_num);
> -            if (head < 0) {
> +            ret = vring_pop(s->vdev, &s->vring, &elem);
> +            if (ret < 0) {
>                  break; /* no more requests */

elem is leaked - we don't vring_push(elem)!

>              }
>  
> -            trace_virtio_blk_data_plane_process_request(s, out_num, in_num,
> -                                                        head);
> +            trace_virtio_blk_data_plane_process_request(s, elem->out_num,
> +                                                        elem->in_num, 
> elem->index);
>  
> -            if (process_request(&s->ioqueue, iov, out_num, in_num, head) < 
> 0) {
> +            if (process_request(&s->ioqueue, elem) < 0) {
>                  vring_set_broken(&s->vring);
>                  break;

elem is leaked on -EFAULT.

> @@ -268,6 +270,10 @@ int vring_pop(VirtIODevice *vdev, Vring *vring,
>       * the index we've seen. */
>      head = vring->vr.avail->ring[last_avail_idx % num];
>  
> +    elem = *p_elem = g_slice_new(VirtQueueElement);
> +    memset(elem, 0, sizeof(*elem));

VirtQueueElement is 48 KB.  We cannot affort to memset, see
de6c8042ec55da18702fa51f09072fcaa315edc3.  At that time dd if=/dev/vda
of=/dev/null iflag=direct bs=8k resulted in 10% host CPU utilization in
memset.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]