qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] iscsi: partly avoid iovec linearization in iscs


From: ronnie sahlberg
Subject: Re: [Qemu-devel] [PATCH] iscsi: partly avoid iovec linearization in iscsi_aio_writev
Date: Mon, 19 Nov 2012 07:56:17 -0800

On Mon, Nov 19, 2012 at 7:18 AM, Paolo Bonzini <address@hidden> wrote:
> 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?
>

I am working on that,  but I will need the thanksgiving weekend to
finish it and test it.
It also means breaking the API, since it would introduce new
functionality  so it will take a little while after finishing the
libiscsi part before we could/should introduce it in qemu.

The vast majority of writes seems to be a vector with only a single
element,  so Peters change is a good optimization for the common case,
until I get the proper fix finished and tested and pushed in a new
release of libiscsi.

I.e.  I think Peters change is good for now.  It solves the problem
with "extra memcpy" for the majority of writes until we can get the
full solution ready.


> Paolo



reply via email to

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