All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Dushyant Bansal <cs5070214@cse.iitd.ac.in>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: KVM call agenda for Jan 25
Date: Mon, 28 Feb 2011 08:36:24 +0100	[thread overview]
Message-ID: <m3aahg391j.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <AANLkTikGeDvT7zq4UbBh-FpCUDrSQ-uoNBp_mJVpKx68@mail.gmail.com> (Stefan Hajnoczi's message of "Sun, 27 Feb 2011 10:49:33 +0000")

Stefan Hajnoczi <stefanha@gmail.com> writes:

> On Sat, Feb 26, 2011 at 9:50 PM, Dushyant Bansal
> <cs5070214@cse.iitd.ac.in> wrote:
>> Disk block size is usually 512 bytes and in qemu-img, sector size is also
>> 512B. And, this change would  copy n sectors even if only one of them
>> actually contains data (while cp checks and copies one block(=sector) at a
>> time). Therefore, it will end up writing more data than cp.
>
> cp(1) from GNU coreutils 8.5 works in units of 32 KB on my system.  It
> reads 32 KB and checks for all zeroes.  If there are all zeroes, it
> seeks ahead 32 KB in the output file.  Otherwise it writes the entire
> 32 KB.

The latest version[*] of cp does better:

    cp now copies sparse files efficiently on file systems with FIEMAP
    support (ext4, btrfs, xfs, ocfs2).  Before, it had to read 2^20 bytes
    when copying a 1MiB sparse file.  Now, it copies bytes only for the
    non-sparse sections of a file.  Similarly, to induce a hole in the
    output file, it had to detect a long sequence of zero bytes.  Now,
    it knows precisely where each hole in an input file is, and can
    reproduce them efficiently in the output file.  mv also benefits
    when it resorts to copying, e.g., between file systems.

But beware of kernel bugs[**].

> You can check what cp(1) is doing using strace(1).

Often enlightening :)

[...]

[*] http://lists.gnu.org/archive/html/coreutils-announce/2011-02/msg00000.html

[**] http://lwn.net/Articles/429345/
Subscribera-only, should become public soon.  In the meantime, try
http://lwn.net/Articles/429349/

  reply	other threads:[~2011-02-28  7:38 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24 13:25 KVM call agenda for Jan 25 Chris Wright
2011-01-24 13:25 ` [Qemu-devel] " Chris Wright
2011-01-24 22:06 ` Anthony Liguori
2011-01-24 22:06   ` [Qemu-devel] " Anthony Liguori
2011-01-25 13:57   ` Luiz Capitulino
2011-01-25 14:02     ` Luiz Capitulino
2011-01-25 14:13       ` Stefan Hajnoczi
2011-01-25 14:13         ` Stefan Hajnoczi
2011-01-29 10:50         ` Dushyant Bansal
2011-01-29 13:16           ` Stefan Hajnoczi
2011-02-25 17:42           ` Dushyant Bansal
2011-02-26 14:05             ` Stefan Hajnoczi
2011-02-26 21:50               ` Dushyant Bansal
2011-02-27 10:49                 ` Stefan Hajnoczi
2011-02-28  7:36                   ` Markus Armbruster [this message]
2011-02-28 20:41                   ` Dushyant Bansal
2011-03-01  9:40                     ` Stefan Hajnoczi
2011-03-14 15:13                       ` Dushyant Bansal
2011-03-15 10:27                         ` Kevin Wolf
2011-03-16 14:17                           ` Dushyant Bansal
2011-03-16 17:47                           ` Stefan Hajnoczi
2011-03-17 10:07                             ` Kevin Wolf
2011-03-26 21:56                               ` Dushyant Bansal
2011-03-28 10:26                                 ` Kevin Wolf
2011-01-25 14:11     ` Aurelien Jarno
2011-01-25 14:11       ` Aurelien Jarno
2011-01-25 14:27       ` Anthony Liguori
2011-01-25 14:27         ` Anthony Liguori
2011-01-25 14:42       ` Kevin Wolf
2011-01-25 14:42         ` Kevin Wolf
2011-01-25 15:29         ` Aurelien Jarno
2011-01-25 14:26   ` Avi Kivity
2011-01-25 14:26     ` [Qemu-devel] " Avi Kivity
2011-01-25 14:35     ` Stefan Hajnoczi
2011-01-25 14:35       ` [Qemu-devel] " Stefan Hajnoczi
2011-01-26  9:58       ` Avi Kivity
2011-01-26  9:58         ` [Qemu-devel] " Avi Kivity

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=m3aahg391j.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=cs5070214@cse.iitd.ac.in \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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 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.