qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Dushyant Bansal <cs5070214@cse.iitd.ac.in>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: KVM call agenda for Jan 25
Date: Sat, 26 Feb 2011 14:05:51 +0000	[thread overview]
Message-ID: <AANLkTik6de8nkuS6xz6btOkqjTMTKmOm_B+Jy9DCa2Tk@mail.gmail.com> (raw)
In-Reply-To: <4D67E9EB.7090606@cse.iitd.ac.in>

On Fri, Feb 25, 2011 at 5:42 PM, Dushyant Bansal
<cs5070214@cse.iitd.ac.in> wrote:
> On Saturday 29 January 2011 04:20 PM, Dushyant Bansal wrote:
>>
>> Or this: which is faster, qemu-img convert -f<format>  -O<format>
>> <src-image>  <dst-image>  or cp<src-image>  <dst-image>?  What about for
>> raw images, shouldn't that be the same speed as cp(1)?  Poke around
>> the source code, profile it, understand what it's doing, think about
>> ways to improve it.  No need to do everything, just doing part of this
>> will give you background on QEMU's block layer.
>>
>> Contributing patches is a good way get up to speed and show your
>> skills.  If time doesn't permit that, just think about the problem and
>> how you intend to solve it, and feel free to bounce ideas off me.
>>
>
> I explored 'qemu-img create and convert' and got a basic understanding of
> how they work.

Great, it's good to hear from you.

> cp faster than qemu-img convert

Yes, I've experienced that too.

> For raw->raw
> In cp, it just copies all the disk blocks actually occupied by the file.
> And, with qemu-img convert, it checks all the sectors and copy those, which
> contains atleast one non-NUL byte.
> The better performance of cp over qemu-img convert is the result of overhead
> of this checking.

How did you find out what cp(1) and qemu-img do?

How does cp(1) know which disk blocks are actually occupied?

> I tried a few variations:
> 1. just copy all the sectors without checking
> So, actual size becomes equal to virtual size.

Did that make qemu-img faster for the image file you tested?

> 2. In is_allocated_sectors,out of n sectors, if any sector has a non-NUL
> byte then break and copy all n sectors.
> As expected, resultant raw image was quite large in size.

This is kind of like what cp(1) does, except it limits n to 32 KB
maximum at a time.  Maybe if you add this tweak they will show similar
performance.  The drawback is that the output image is larger than
with the current approach.

Stefan

  reply	other threads:[~2011-02-26 14:06 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24 13:25 [Qemu-devel] KVM call agenda for Jan 25 Chris Wright
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-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 [this message]
2011-02-26 21:50               ` Dushyant Bansal
2011-02-27 10:49                 ` Stefan Hajnoczi
2011-02-28  7:36                   ` Markus Armbruster
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:27       ` Anthony Liguori
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:35     ` Stefan Hajnoczi
2011-01-26  9:58       ` 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=AANLkTik6de8nkuS6xz6btOkqjTMTKmOm_B+Jy9DCa2Tk@mail.gmail.com \
    --to=stefanha@gmail.com \
    --cc=cs5070214@cse.iitd.ac.in \
    --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).