From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TaT7f-0000k4-QD for qemu-devel@nongnu.org; Mon, 19 Nov 2012 10:19:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TaT7a-0002QE-0n for qemu-devel@nongnu.org; Mon, 19 Nov 2012 10:18:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TaT7Z-0002Q8-PP for qemu-devel@nongnu.org; Mon, 19 Nov 2012 10:18:49 -0500 Message-ID: <50AA4DD1.6000609@redhat.com> Date: Mon, 19 Nov 2012 16:18:41 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <50AA4917.5000402@dlhnet.de> In-Reply-To: <50AA4917.5000402@dlhnet.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] iscsi: partly avoid iovec linearization in iscsi_aio_writev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, "qemu-devel@nongnu.org" , ronnie sahlberg 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