[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 6/7] qcow2: Pass a QEMUIOVector to do_perform
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-block] [PATCH v2 6/7] qcow2: Pass a QEMUIOVector to do_perform_cow_{read, write}() |
Date: |
Fri, 16 Jun 2017 17:31:27 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 07.06.2017 um 16:08 hat Alberto Garcia geschrieben:
> Instead of passing a single buffer pointer to do_perform_cow_write(),
> pass a QEMUIOVector. This will allow us to merge the write requests
> for the COW regions and the actual data into a single one.
>
> Although do_perform_cow_read() does not strictly need to change its
> API, we're doing it here as well for consistency.
>
> Signed-off-by: Alberto Garcia <address@hidden>
> ---
> block/qcow2-cluster.c | 51
> ++++++++++++++++++++++++---------------------------
> 1 file changed, 24 insertions(+), 27 deletions(-)
> @@ -807,22 +798,25 @@ static int perform_cow(BlockDriverState *bs, QCowL2Meta
> *m)
> /* The part of the buffer where the end region is located */
> end_buffer = start_buffer + buffer_size - end->nb_bytes;
>
> + qemu_iovec_init(&qiov, 3);
> +
You don't actually make use of more than one iovec in this patch. And
after the last patch, the value is potentially too low - which isn't
fatal because this is not a fixed maximum, but just a hint, but it can
cause unnecessary memory allocations.
It would probably be better to use 1 here and change it into
2 + m->data_qiov->niov when you add write merging.
Kevin
- Re: [Qemu-block] [PATCH v2 7/7] qcow2: Merge the writing of the COW regions with the guest data, (continued)
- [Qemu-block] [PATCH v2 3/7] qcow2: Make perform_cow() call do_perform_cow() twice, Alberto Garcia, 2017/06/07
- [Qemu-block] [PATCH v2 6/7] qcow2: Pass a QEMUIOVector to do_perform_cow_{read, write}(), Alberto Garcia, 2017/06/07
- [Qemu-block] [PATCH v2 5/7] qcow2: Allow reading both COW regions with only one request, Alberto Garcia, 2017/06/07
- [Qemu-block] [PATCH v2 4/7] qcow2: Split do_perform_cow() into _read(), _encrypt() and _write(), Alberto Garcia, 2017/06/07
- Re: [Qemu-block] [PATCH v2 0/7] qcow2: Reduce the number of I/O ops when doing COW, Kevin Wolf, 2017/06/16