All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Lieven <pl@dlhnet.de>
Cc: kwolf@redhat.com, "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	ronnie sahlberg <ronniesahlberg@gmail.com>
Subject: Re: [Qemu-devel] [PATCH] iscsi: partly avoid iovec linearization in iscsi_aio_writev
Date: Mon, 19 Nov 2012 16:18:41 +0100	[thread overview]
Message-ID: <50AA4DD1.6000609@redhat.com> (raw)
In-Reply-To: <50AA4917.5000402@dlhnet.de>

Il 19/11/2012 15:58, Peter Lieven ha scritto:
> 
> -    /* XXX we should pass the iovec to write16 to avoid the extra copy */
> -    /* this will allow us to get rid of 'buf' completely */
>      size = nb_sectors * BDRV_SECTOR_SIZE;
> -    acb->buf = g_malloc(size);
> -    qemu_iovec_to_buf(acb->qiov, 0, acb->buf, size);
> +    data.size = size;
> +
> +    /* if the iovec only contains one buffer we can pass it directly */
> +    if (acb->qiov->niov == 1) {
> +        acb->buf = NULL;
> +        data.data = acb->qiov->iov[0].iov_base;
> +    } else {
> +        acb->buf = g_malloc(size);
> +        qemu_iovec_to_buf(acb->qiov, 0, acb->buf, size);
> +        data.data = acb->buf;
> +    }

Looks good, but how hard is it to get rid of the bounce buffer
completely, as mentioned in the comment?  Ronnie?

Paolo

  reply	other threads:[~2012-11-19 15:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-19 14:58 [Qemu-devel] [PATCH] iscsi: partly avoid iovec linearization in iscsi_aio_writev Peter Lieven
2012-11-19 15:18 ` Paolo Bonzini [this message]
2012-11-19 15:23   ` Peter Lieven
2012-11-19 15:56   ` ronnie sahlberg
2012-11-20 15:51 ` Stefan Hajnoczi
2012-11-20 16:16   ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50AA4DD1.6000609@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pl@dlhnet.de \
    --cc=qemu-devel@nongnu.org \
    --cc=ronniesahlberg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.