From: Laurent Vivier <Laurent.Vivier@bull.net>
To: Kevin Wolf <kwolf@suse.de>
Cc: qemu-devel@nongnu.org, Shahar Frank <shaharf@qumranet.com>
Subject: Re: [Qemu-devel][PATCH,RFC] Zero cluster dedup
Date: Wed, 03 Sep 2008 10:25:37 +0200 [thread overview]
Message-ID: <1220430337.4159.14.camel@frecb07144> (raw)
In-Reply-To: <48BE473C.4090102@suse.de>
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
--
----------------- Laurent.Vivier@bull.net ------------------
"La perfection est atteinte non quand il ne reste rien à
ajouter mais quand il ne reste rien à enlever." Saint Exupéry
next prev parent reply other threads:[~2008-09-03 8:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-02 16:28 [Qemu-devel][PATCH,RFC] Zero cluster dedup Shahar Frank
2008-09-03 7:09 ` Laurent Vivier
2008-09-03 7:35 ` Shahar Frank
2008-09-03 7:59 ` Laurent Vivier
2008-09-03 8:13 ` Kevin Wolf
2008-09-03 8:25 ` Laurent Vivier [this message]
2008-09-03 9:38 ` Kevin Wolf
2008-09-03 12:05 ` Shahar Frank
2008-09-03 12:47 ` Kevin Wolf
2008-09-03 13:07 ` Shahar Frank
2008-09-03 13:12 ` Laurent Vivier
2008-09-03 17:44 ` Shahar Frank
2008-09-03 13:09 ` Laurent Vivier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1220430337.4159.14.camel@frecb07144 \
--to=laurent.vivier@bull.net \
--cc=kwolf@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=shaharf@qumranet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).