[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: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 10/20] mirror: add buf-size argument to drive-mirror |
Date: |
Sat, 15 Dec 2012 04:09:06 -0500 (EST) |
> 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.
I silently make it large if it gives something *smaller*. The job
always has to copy one granularity-sized chunk.
> > +++ 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?
It is arbitrary, though making it too big makes little sense.
> > - "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?
I don't clamp it, I make it _at least_ as big as the granularity.
Paolo
- [Qemu-devel] [PATCH 06/20] block: return count of dirty sectors, not chunks, (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
- [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