[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/21] qcow2: Refcount overflow and qcow2_alloc_
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 05/21] qcow2: Refcount overflow and qcow2_alloc_bytes() |
Date: |
Mon, 10 Nov 2014 14:12:07 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
On 11/10/2014 06:45 AM, Max Reitz wrote:
> qcow2_alloc_bytes() may reuse a cluster multiple times, in which case
> the refcount is increased accordingly. However, if this would lead to an
> overflow the function should instead just not reuse this cluster and
> allocate a new one.
So if recount_order is 1 (2 bits per refcount, max refcount of 4), and
we encounter the same cluster 6 times (say by 5 back-to-back internal
snapshots), does this code optimize to only 2 clusters (both with
refcount 3) or does it result in each of the last 3 clusters spilling to
its own 1-ref cluster for a total of 4 clusters? Short of Benoit's work
on deduplication, is there even a way to avoid inefficient use of
spilled clusters? But I guess answering that can be a separate patch;
inefficiency is annoying, but not technically wrong and therefore not a
reason to reject this one.
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> block/qcow2-refcount.c | 32 ++++++++++++++++++++++++++++++--
> 1 file changed, 30 insertions(+), 2 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
- Re: [Qemu-devel] [PATCH 03/21] qcow2: Use 64 bits for refcount values, (continued)
[Qemu-devel] [PATCH 02/21] qcow2: Add refcount_width to format-specific info, Max Reitz, 2014/11/10
[Qemu-devel] [PATCH 04/21] qcow2: Respect error in qcow2_alloc_bytes(), Max Reitz, 2014/11/10
[Qemu-devel] [PATCH 05/21] qcow2: Refcount overflow and qcow2_alloc_bytes(), Max Reitz, 2014/11/10
- Re: [Qemu-devel] [PATCH 05/21] qcow2: Refcount overflow and qcow2_alloc_bytes(),
Eric Blake <=
- Re: [Qemu-devel] [PATCH 05/21] qcow2: Refcount overflow and qcow2_alloc_bytes(), Max Reitz, 2014/11/11
- Re: [Qemu-devel] [PATCH 05/21] qcow2: Refcount overflow and qcow2_alloc_bytes(), Eric Blake, 2014/11/11
- Re: [Qemu-devel] [PATCH 05/21] qcow2: Refcount overflow and qcow2_alloc_bytes(), Max Reitz, 2014/11/11
- Re: [Qemu-devel] [PATCH 05/21] qcow2: Refcount overflow and qcow2_alloc_bytes(), Eric Blake, 2014/11/11
- Re: [Qemu-devel] [PATCH 05/21] qcow2: Refcount overflow and qcow2_alloc_bytes(), Max Reitz, 2014/11/12
[Qemu-devel] [PATCH 07/21] qcow2: Helper for refcount array size calculation, Max Reitz, 2014/11/10
[Qemu-devel] [PATCH 08/21] qcow2: More helpers for refcount modification, Max Reitz, 2014/11/10