From: Eric Blake <eblake@redhat.com>
To: David Edmondson <dme@dme.org>, Sam Eiderman <sameid@google.com>,
Kevin Wolf <kwolf@redhat.com>
Cc: Tony Zhang <tzz@google.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
Max Reitz <mreitz@redhat.com>
Subject: Re: Clarification regarding new qemu-img convert --target-is-zero flag
Date: Wed, 10 Jun 2020 11:21:27 -0500 [thread overview]
Message-ID: <03718921-c988-98e2-3a72-3f10b9f14fcd@redhat.com> (raw)
In-Reply-To: <m28sgu9ame.fsf@dme.org>
On 6/10/20 10:57 AM, David Edmondson wrote:
> On Wednesday, 2020-06-10 at 10:48:52 -05, Eric Blake wrote:
>
>> On 6/10/20 10:42 AM, David Edmondson wrote:
>>> On Wednesday, 2020-06-10 at 18:29:33 +03, Sam Eiderman wrote:
>>>
>>>> Excuse me,
>>>>
>>>> Vladimir already pointed out in the first comment that it will skip
>>>> writing real zeroes later.
>>>
>>> Right. That's why you want something like "--no-need-to-zero-initialise"
>>> (the name keeps getting longer!), which would still write zeroes to the
>>> blocks that should contain zeroes, as opposed to writing zeroes to
>>> prepare the device.
>>
>> Or maybe something like:
>>
>> qemu-img convert --skip-unallocated
>
> This seems fine.
>
>> which says that a pre-zeroing pass may be attempted, but it if fails,
>
> This bit puzzles me. In what circumstances might we attempt but fail?
> Does it really mean "if it can be done instantly, it will be done, but
> not if it costs something"?
A fast pre-zeroing pass is faster than writing explicit zeroes. If such
a fast pass works, then you can avoid further I/O for all subsequent
zero sections; the unallocated sections will now happen to read as zero,
but that is not a problem since the content of unallocated portions is
not guaranteed.
But if pre-zeroing is not fast, then you have to spend the extra I/O to
explicitly zero the portions that are allocated but read as zero, while
still skipping the unallocated portions.
>
> I'd be more inclined to go for "unallocated blocks will not be written",
> without any attempts to pre-zero.
But that can be slower, when pre-zeroing is fast. "Unallocated blocks
need not be written" allows for optimizations, "unallocated blocks must
not be touched" does not.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2020-06-10 16:23 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-10 5:28 Clarification regarding new qemu-img convert --target-is-zero flag Sam Eiderman
2020-06-10 6:16 ` Vladimir Sementsov-Ogievskiy
2020-06-10 6:28 ` Sam Eiderman
2020-06-10 11:37 ` Kevin Wolf
2020-06-10 11:52 ` Sam Eiderman
2020-06-10 11:56 ` David Edmondson
2020-06-10 12:19 ` Sam Eiderman
2020-06-10 13:36 ` Vladimir Sementsov-Ogievskiy
2020-06-10 14:06 ` Kevin Wolf
2020-06-10 15:26 ` Sam Eiderman
2020-06-10 15:29 ` Sam Eiderman
2020-06-10 15:42 ` David Edmondson
2020-06-10 15:47 ` Sam Eiderman
2020-06-10 15:48 ` Eric Blake
2020-06-10 15:57 ` David Edmondson
2020-06-10 16:21 ` Eric Blake [this message]
2020-06-11 10:58 ` David Edmondson
2020-06-10 16:31 ` Kevin Wolf
2020-06-11 13:41 ` Sam Eiderman
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=03718921-c988-98e2-3a72-3f10b9f14fcd@redhat.com \
--to=eblake@redhat.com \
--cc=dme@dme.org \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sameid@google.com \
--cc=tzz@google.com \
--cc=vsementsov@virtuozzo.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).