qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v12 03/14] qcow2: Optimize bdrv_make_empty()


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v12 03/14] qcow2: Optimize bdrv_make_empty()
Date: Fri, 10 Oct 2014 09:34:10 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1

On 10/10/2014 06:32 AM, Eric Blake wrote:
> On 08/26/2014 03:36 PM, Max Reitz wrote:
>> bdrv_make_empty() is currently only called if the current image
>> represents an external snapshot that has been committed to its base
>> image; it is therefore unlikely to have internal snapshots. In this
>> case, bdrv_make_empty() can be greatly sped up by emptying the L1 and
>> refcount table (while having the dirty flag set) and creating a trivial
>> refcount structure.
>>
>> If there are snapshots, fall back to the simple implementation (discard
>> all clusters).

Brain-wave...


>> +        /* Refcounts will be broken utterly */
>> +        ret = qcow2_mark_dirty(bs);
> 
> qcow2_mark_dirty does assert(s->qcow_version >= 3).  But this code can
> be reached when committing a qcow2 0.10 compat-level file, right?

What if you use the fallback of the slower code on compat=0.10 files?
It's no worse than it has always been, and after all, this patch is
about adding an optimization, not adding new behavior.  It's okay if the
optimization is only usable on compat=1.1 files.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]