qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Max Reitz <mreitz@redhat.com>
Cc: qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] qemu-img: Drop BLK_ZERO from convert
Date: Tue, 27 Feb 2018 16:17:43 +0000	[thread overview]
Message-ID: <20180227161743.GC32480@stefanha-x1.localdomain> (raw)
In-Reply-To: <20180226170313.8178-1-mreitz@redhat.com>

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

On Mon, Feb 26, 2018 at 06:03:13PM +0100, Max Reitz wrote:
> There are filesystems (among which is tmpfs) that have a hard time
> reporting allocation status.  That is definitely a bug in them.
> 
> However, there is no good reason why qemu-img convert should query the
> allocation status in the first place.  It does zero detection by itself
> anyway, so we can detect unallocated areas ourselves.
> 
> Furthermore, if a filesystem driver has any sense, reading unallocated
> data should take just as much time as lseek(SEEK_DATA) + memset().  So
> the only overhead we introduce by dropping the manual lseek() call is a
> memset() in the driver and a buffer_is_zero() in qemu-img, both of which
> should be relatively quick.

This makes sense.  Which file systems did you test this patch on?

XFS, ext4, and tmpfs would be a good minimal test set to prove the
patch.  Perhaps with two input files:
1. A file that is mostly filled with data.
2. A file that is only sparsely populated with data.

The time taken should be comparable with the time before this patch.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2018-02-27 16:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26 17:03 [Qemu-devel] [RFC] qemu-img: Drop BLK_ZERO from convert Max Reitz
2018-02-27 16:17 ` Stefan Hajnoczi [this message]
2018-02-28 18:08   ` Max Reitz
2018-02-28 20:11     ` Max Reitz
2018-02-28 20:23       ` Max Reitz
2018-03-06 13:47       ` Stefan Hajnoczi
2018-03-06 17:37         ` Kevin Wolf
2018-03-07 15:57           ` Max Reitz
2018-03-07 16:33             ` Paolo Bonzini
2018-03-07 17:11               ` Max Reitz
2018-03-07 17:05             ` Kevin Wolf
2018-03-07 17:22               ` 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=20180227161743.GC32480@stefanha-x1.localdomain \
    --to=stefanha@gmail.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 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).