[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/20] block: allow customizing the granularity
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 07/20] block: allow customizing the granularity of the dirty bitmap |
Date: |
Sat, 15 Dec 2012 04:11:38 -0500 (EST) |
----- Messaggio originale -----
> Da: "Eric Blake" <address@hidden>
> A: "Paolo Bonzini" <address@hidden>
> Cc: address@hidden, address@hidden, address@hidden, address@hidden
> Inviato: Venerdì, 14 dicembre 2012 22:27:04
> Oggetto: Re: [PATCH 07/20] block: allow customizing the granularity of the
> dirty bitmap
>
> On 12/12/2012 06:46 AM, Paolo Bonzini wrote:
> > Signed-off-by: Paolo Bonzini <address@hidden>
> > ---
> > block-migration.c | 5 +++--
> > block.c | 17 ++++++++++-------
> > block.h | 5 +----
> > block/mirror.c | 14 ++++----------
> > qapi-schema.json | 4 +++-
> > 5 files changed, 21 insertions(+), 24 deletions(-)
> >
>
> > @@ -4218,16 +4220,17 @@ void *qemu_blockalign(BlockDriverState *bs,
> > size_t size)
> > return qemu_memalign((bs && bs->buffer_alignment) ?
> > bs->buffer_alignment : 512, size);
> > }
> >
> > -void bdrv_set_dirty_tracking(BlockDriverState *bs, int enable)
> > +void bdrv_set_dirty_tracking(BlockDriverState *bs, int
> > granularity)
> > {
> > int64_t bitmap_size;
> >
> > - if (enable) {
> > - if (!bs->dirty_bitmap) {
> > - bitmap_size = (bdrv_getlength(bs) >>
> > BDRV_SECTOR_BITS);
> > - bs->dirty_bitmap = hbitmap_alloc(bitmap_size,
> > -
> >
> > BDRV_LOG_SECTORS_PER_DIRTY_CHUNK);
> > - }
> > + assert((granularity & (granularity - 1)) == 0);
> > +
> > + if (granularity) {
> > + granularity >>= BDRV_SECTOR_BITS;
>
> Given that granularity is specified in bytes, does it make sense for
> a user to want a granularity of 4G?
No, the point of the HBitmap is to allow small granularities. Anything
bigger than 1 or 2 MB makes little sense.
Paolo
- [Qemu-devel] [PATCH 02/20] add hierarchical bitmap data type and test cases, (continued)
- [Qemu-devel] [PATCH 02/20] add hierarchical bitmap data type and test cases, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 04/20] block: make round_to_clusters public, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 03/20] block: implement dirty bitmap using HBitmap, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 05/20] mirror: perform COW if the cluster size is bigger than the granularity, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 07/20] block: allow customizing the granularity of the dirty bitmap, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 06/20] block: return count of dirty sectors, not chunks, Paolo Bonzini, 2012/12/12
- [Qemu-devel] [PATCH 09/20] mirror: switch mirror_iteration to AIO, Paolo Bonzini, 2012/12/12
- [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