All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/4] block/null-{co, aio}: Return zeros when read
Date: Mon, 22 Feb 2016 09:31:44 -0700	[thread overview]
Message-ID: <56CB37F0.8080805@redhat.com> (raw)
In-Reply-To: <1455989993-1917-3-git-send-email-mreitz@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1207 bytes --]

On 02/20/2016 10:39 AM, Max Reitz wrote:
> Currently, we do not define exactly what is returned when read, but
> having a reliable source of zeros is always nice.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  block/null.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/block/null.c b/block/null.c
> index d90165d..ad883d9 100644
> --- a/block/null.c
> +++ b/block/null.c
> @@ -90,6 +90,7 @@ static coroutine_fn int null_co_readv(BlockDriverState *bs,
>                                        int64_t sector_num, int nb_sectors,
>                                        QEMUIOVector *qiov)
>  {
> +    qemu_iovec_memset(qiov, 0, 0, nb_sectors * BDRV_SECTOR_SIZE);
>      return null_co_common(bs);
>  }

Shouldn't this be made optional?  That is, one of the points of null-co
was to be as fast as possible, and the memset will slow us down.  So
having an optional bool as part of the null-co setup, which defaults off
for back-compat but can be turned on for guaranteed all-zero reads,
sounds like it would be nicer than forcing all-zero reads.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2016-02-22 16:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-20 17:39 [Qemu-devel] [PATCH 0/4] qemu-img: Fix preallocation with -S 0 for convert Max Reitz
2016-02-20 17:39 ` [Qemu-devel] [PATCH 1/4] " Max Reitz
2016-02-22 12:50   ` Kevin Wolf
2016-02-22 16:43     ` Max Reitz
2016-02-22 17:24       ` Max Reitz
2016-02-20 17:39 ` [Qemu-devel] [PATCH 2/4] block/null-{co, aio}: Return zeros when read Max Reitz
2016-02-22 16:31   ` Eric Blake [this message]
2016-02-22 16:45     ` Max Reitz
2016-02-20 17:39 ` [Qemu-devel] [PATCH 3/4] block/null-{co, aio}: Implement get_block_status() Max Reitz
2016-02-20 17:39 ` [Qemu-devel] [PATCH 4/4] iotests: Test qemu-img convert -S 0 behavior Max Reitz

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=56CB37F0.8080805@redhat.com \
    --to=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.