[Top][All Lists]
[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 10:25:37 +0200 |
Le mercredi 03 septembre 2008 à 10:13 +0200, Kevin Wolf a écrit :
> Laurent Vivier schrieb:
> > Le mercredi 03 septembre 2008 à 00:35 -0700, Shahar Frank a écrit :
> >>> 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).
> >> You are correct if this is a standalone image i.e. without backing
> >> file. If the image has a backing file, a zero mapping is interpreted
> >> as "read it from the backing file at the same (logical) offset".
> >
> > I think backing file is also qcow2, so if you write all zeros the
> > behavior will be the same, and read from the backing file will use also
> > memset().
>
> Not if the cluster is already used in the backing file. Then you would
> write 0 to the L2 table of the image itself but not to the L2 table of
> the backing file (if you did, it would be a bug). So a read would
> operate on the old allocation of the backing file rather than on zeros.
Yes, you're right.
Laurent
--
----------------- address@hidden ------------------
"La perfection est atteinte non quand il ne reste rien à
ajouter mais quand il ne reste rien à enlever." Saint Exupéry
Re: [Qemu-devel][PATCH,RFC] Zero cluster dedup, Kevin Wolf, 2008/09/03
- RE: [Qemu-devel][PATCH,RFC] Zero cluster dedup, Shahar Frank, 2008/09/03
- Re: [Qemu-devel][PATCH,RFC] Zero cluster dedup, Kevin Wolf, 2008/09/03
- RE: [Qemu-devel][PATCH,RFC] Zero cluster dedup, Shahar Frank, 2008/09/03
- RE: [Qemu-devel][PATCH,RFC] Zero cluster dedup, Laurent Vivier, 2008/09/03
- RE: [Qemu-devel][PATCH,RFC] Zero cluster dedup, Shahar Frank, 2008/09/03
Re: [Qemu-devel][PATCH,RFC] Zero cluster dedup, Laurent Vivier, 2008/09/03