[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/20] mirror: perform COW if the cluster size i
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 05/20] mirror: perform COW if the cluster size is bigger than the granularity |
Date: |
Fri, 14 Dec 2012 13:21:26 -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:
> When mirroring runs, the backing files for the target may not yet be
> ready. However, this means that a copy-on-write operation on the target
> would fill the missing sectors with zeros. Copy-on-write only happens
> if the granularity of the dirty bitmap is smaller than the cluster size
> (and only for clusters that are allocated in the source after the job
> has started copying). So far, the granularity was fixed to 1MB; to avoid
> the problem we detected the situation and required the backing files to
> be available in that case only.
>
> However, we want to lower the granularity for efficiency, so we need
> a better solution. The solution is to always copy a whole cluster the
> first time it is touched. The code keeps a bitmap of clusters that
> have already been allocated by the mirroring job, and only does "manual"
> copy-on-write if the chunk being copied is zero in the bitmap.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> block/mirror.c | 60
> +++++++++++++++++++++++++++++++++++++++-------
> blockdev.c | 15 +++---------
> tests/qemu-iotests/041 | 21 ++++++++++++++++
> tests/qemu-iotests/041.out | 4 ++--
> trace-events | 1 +
> 5 files changed, 78 insertions(+), 23 deletions(-)
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 00/20] Block device mirroring enhancements, 12-12-12 edition, Paolo Bonzini, 2012/12/12
- [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
- Re: [Qemu-devel] [PATCH 05/20] mirror: perform COW if the cluster size is bigger than the granularity,
Eric Blake <=
- [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