qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel][PATCH,RFC] Zero cluster dedup


From: Laurent Vivier
Subject: Re: [Qemu-devel][PATCH,RFC] Zero cluster dedup
Date: Wed, 03 Sep 2008 09:09:35 +0200

Le mardi 02 septembre 2008 à 09:28 -0700, Shahar Frank a écrit :
> Hi All,
> 
> The following patch is implementing a zero cluster dedup feature to
> the qcow2 image format.
> 
> The incentive for this feature is the image COW "inflation" problem
> (i.e. COW image growth). The causes for the COW image pollution are
> many; for example, Windows with NTFS do not reuse recently
> de-allocated space and by that pollute many blocks. A naïve solution
> would be to identify de-allocated space and de-allocate it from the
> image block space. The problems with this approach are that 1) this
> requires a windows side interface to the image, and 2) there is no
> de-allocate verb for the images.
> 
> The suggested solution is simple:
>       1) Use windows side cleanup/wipe utilities such as "Erase" "Free Wipe
> Wizard" or "Disk Redactor" (or any other free/non free wipe utility)
> to periodically wipe free space and cleanup temporaries. Most
> utilities can be used to write *zeros* on the wiped blocks. 
>       2) Make qcow2 to identify zero cluster writes and use them as
> de-allocation hints (or "make hole" verb). To implement such feature
> with minimal effort and minimal changes, I suggest to use the internal
> COW mechanism of the qcow2 to create a shared zero cluster. To avoid
> image format changes, such page is created on demand and then can be
> shared with all zero writes. A non zero write on the zero cluster will
> cause a normal COW operation (similar to the shared kernel zero
> page). 

Is it really needed to have a shared zero page ?

When I read qcow_read() and qcow_aio_read_cb() I see:

if (!cluster_offset) {
...
memset(buf, 0, 512 * n);
...
}
and so I think you have just to clear the l2_table entry for the given
clusters (and free them).

Regards,
Laurent
-- 
----------------- address@hidden  ------------------
  "La perfection est atteinte non quand il ne reste rien à
ajouter mais quand il ne reste rien à enlever." Saint Exupéry





reply via email to

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