qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luke -Jr <luke@dashjr.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] copy on write-but-no-change
Date: Fri, 7 Sep 2007 10:40:15 -0500	[thread overview]
Message-ID: <200709071040.15626.luke@dashjr.org> (raw)
In-Reply-To: <46E0854D.8000301@lapo.it>

On Thursday 06 September 2007, Lapo Luchini wrote:
> I noticed that cow adds space also if the written data is the same as
> the one it was there already.
> Is there a reason why checking it would be bad/difficult/slow/other?
> Simply no one had the will to code the check?

Simply that your operation is not very common, and checking every time would 
put read overhead on top of write overhead. If you want to check, feel free 
to check prior to issuing the write. ;)

> I ask because for shrinking drives I usually create big zero-filled
> files... and this grows the qcow2 image like mad, and only a compressed
> convert can properly shrink it back. OK, it is not to be done very very
> often, but not copying those writes that don't actually change the data
> seems like a good idea... don't know about the speed hit, though.

I think it's logical to require an explicit conversion when you want to 
shrink.

> Another idea would be to detect "only zero" write blocks and simply
> interpret them as "put a hole in the sparse file" instead of actually
> writing data to disk.

I don't believe it's possible to make holes in sparse files explicitly.
The libc/OS only support it transparently when you jump to the end of a file 
and begin writing there.

  reply	other threads:[~2007-09-07 15:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-06 22:55 [Qemu-devel] copy on write-but-no-change Lapo Luchini
2007-09-07 15:40 ` Luke -Jr [this message]
2007-09-11  6:47   ` Rob Landley

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=200709071040.15626.luke@dashjr.org \
    --to=luke@dashjr.org \
    --cc=qemu-devel@nongnu.org \
    /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).