[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 10/20] mirror: add buf-size argument to drive-mi
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 10/20] mirror: add buf-size argument to drive-mirror |
Date: |
Fri, 14 Dec 2012 15:22:43 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
On 12/12/2012 06:46 AM, Paolo Bonzini wrote:
> This makes sense when the next commit starts using the extra buffer space
> to perform many I/O operations asynchronously.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> block/mirror.c | 6 +++---
> block_int.h | 5 +++--
> blockdev.c | 9 ++++++++-
> hmp.c | 2 +-
> qapi-schema.json | 5 ++++-
> qmp-commands.hx | 4 +++-
> tests/qemu-iotests/041 | 31 +++++++++++++++++++++++++++++++
> 7 files changed, 53 insertions(+), 9 deletions(-)
>
> @@ -447,7 +447,7 @@ void mirror_start(BlockDriverState *bs, BlockDriverState
> *target,
> s->target = target;
> s->mode = mode;
> s->granularity = granularity;
> - s->buf_size = granularity;
> + s->buf_size = MAX(buf_size, granularity);
So you silently clamp the buffer size if the user gives something larger
than granularity.
> +++ b/qapi-schema.json
> @@ -1641,6 +1641,9 @@
> # are smaller than that, else the cluster size. Must be a
> # power of 2 between 512 and 64M.
> #
> +# @buf-size: #optional maximum amount of data in flight from source to
> +# target.
Mention that it was added in 1.4. Also, is it worth mentioning
reasonable bounds (such as granularity), and whether it must be a power
of two?
> - "granularity": granularity of the dirty bitmap (json-int, optional)
> +- "buf_size": maximum amount of data in flight from source to target
> + (json-int, default 10M)
Oh, so unlike granularity, this one does NOT have to be a power of 2.
But why is the default 10M if you clamp it to granularity, which
defaults to 64k? (and again, something else I have to figure out how to
expose from libvirt)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH 07/20] block: allow customizing the granularity of the dirty bitmap, (continued)
- [Qemu-devel] [PATCH 08/20] mirror: allow customizing the granularity, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 10/20] mirror: add buf-size argument to drive-mirror, Paolo Bonzini, 2012/12/12
- Re: [Qemu-devel] [PATCH 10/20] mirror: add buf-size argument to drive-mirror,
Eric Blake <=
- [Qemu-devel] [PATCH 12/20] mirror: support arbitrarily-sized iterations, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 11/20] mirror: support more than one in-flight AIO operation, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 13/20] oslib: add a wrapper for mmap/munmap, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 14/20] hbitmap: add hbitmap_alloc_with_data and hbitmap_required_size, Paolo Bonzini, 2012/12/12