All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH RFC] qemu-file: output data directly if possible
Date: Mon, 10 Oct 2011 09:42:51 +0200	[thread overview]
Message-ID: <4E92A1FB.70706@redhat.com> (raw)
In-Reply-To: <20111009235629.GB9542@redhat.com>

On 10/10/2011 01:56 AM, Michael S. Tsirkin wrote:
> qemu file currently always buffers up data before writing it out.
> At least for memory this is probably not a good idea:
> writing out to file would be cheaper. Let's do
> that if we can, which should be the common case. If we can't, buffer.
>
> Signed-off-by: Michael S. Tsirkin<mst@redhat.com>
>
> ---
>
> Completely untested, this is just thinking aloud.
> Shouldn't the below save us a data copy in the
> common case, helping speed up migration?

The problem here is qemu_put_byte and friends, where the indirection of 
a function call would probably slow things down.  In the common case, 
qemu_put_byte is called a lot and f->buf_index would not be zero.  The 
way to go would probably be to merge QEMUFile and QEMUBufferedFile's two 
buffering layers, which also removes a copy.

Paolo

  reply	other threads:[~2011-10-10  7:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-09 23:56 [Qemu-devel] [PATCH RFC] qemu-file: output data directly if possible Michael S. Tsirkin
2011-10-10  7:42 ` Paolo Bonzini [this message]
2011-10-10 13:16   ` Michael S. Tsirkin
2011-10-10  9:25     ` Paolo Bonzini
2011-10-11  9:19     ` Juan Quintela

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=4E92A1FB.70706@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=mst@redhat.com \
    --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.