[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC V5 20/36] qcow2: Drop hash for a given cluster whe
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [RFC V5 20/36] qcow2: Drop hash for a given cluster when dedup makes refcount > 2^16/2. |
Date: |
Wed, 16 Jan 2013 10:46:05 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
On 01/16/2013 09:24 AM, Benoît Canet wrote:
> A new physical cluster with the same hash value will be used for further
> occurence of this hash.
s/occurence/occurrence/
> ---
> block/qcow2-dedup.c | 32 ++++++++++++++++++++++++++++++++
> block/qcow2-refcount.c | 3 +++
> block/qcow2.h | 4 ++++
> 3 files changed, 39 insertions(+)
>
> +++ b/block/qcow2-refcount.c
> @@ -489,6 +489,9 @@ int QEMU_WARN_UNUSED_RESULT
> update_refcount(BlockDriverState *bs,
> ret = -EINVAL;
> goto fail;
> }
> + if (s->has_dedup && deduplication && refcount >= 0xFFFF/2) {
> + qcow2_dedup_refcount_half_max_reached(bs, cluster_index);
You are hardcoding to a width of 16 bits; however, version 3 makes the
refcount field variable-sized:
96 - 99: refcount_order
Describes the width of a reference count block entry
(width
in bits = 1 << refcount_order). For version 2
images, the
order is always assumed to be 4 (i.e. the width is
16 bits).
Hmm, what happens if refcount_order is 0 to disable reference counting?
That setting is valid for creating a qcow2 file that can't be used for
internal snapshots. But it also interferes with dedup; so you probably
want to add some additional requirements in the spec (patch 1/36) that
when dedup is in use, refcount_order must be a minimum value (or require
that it be exactly 4, for a width of 16 bits).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [RFC V5 27/36] qcow2: Add check_dedup_l2 in order to check l2 of dedup table., (continued)
- [Qemu-devel] [RFC V5 27/36] qcow2: Add check_dedup_l2 in order to check l2 of dedup table., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 08/36] qcow2: Implement qcow2_compute_cluster_hash., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 34/36] qcow2: Add qcow2_dedup_init and qcow2_dedup_close., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 09/36] qcow2: Extract qcow2_dedup_grow_table, Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 07/36] qcow2: Add qcow2_dedup_store_new_hashes., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 33/36] qemu-iotests: Filter dedup=on/off so existing tests don't break., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 35/36] qcow2: Add qcow2_co_dedup_resume to restart deduplication., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 31/36] qcow2: Use large L2 table for deduplication., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 36/36] qcow2: Enable the deduplication feature., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 20/36] qcow2: Drop hash for a given cluster when dedup makes refcount > 2^16/2., Benoît Canet, 2013/01/16
- Re: [Qemu-devel] [RFC V5 20/36] qcow2: Drop hash for a given cluster when dedup makes refcount > 2^16/2.,
Eric Blake <=
- [Qemu-devel] [RFC V5 11/36] qcow2: Makes qcow2_alloc_cluster_link_l2 mark to deduplicate clusters., Benoît Canet, 2013/01/16