From: "Michael S. Tsirkin" <mst@redhat.com>
To: Paolo Bonzini <pbonzini@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 11:16:40 -0200 [thread overview]
Message-ID: <20111010131639.GB23679@redhat.com> (raw)
In-Reply-To: <4E92A1FB.70706@redhat.com>
On Mon, Oct 10, 2011 at 09:42:51AM +0200, Paolo Bonzini wrote:
> 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.
True, maybe the right thing to do is use a size cutoff,
avoid a copy if buffer is large enough.
I note the buffer in qemu file is 32K - is that
based on some specific measurements or just
a random large number? Any objections to making
it smaller, like 4K?
> The way to go would probably be to merge QEMUFile and
> QEMUBufferedFile's two buffering layers, which also removes a copy.
>
> Paolo
Yes, it does look sane. QEMUFile doesn't seem to ever be used without
QEMUBufferedFile - is that true?
--
MST
next prev parent reply other threads:[~2011-10-10 9:15 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
2011-10-10 13:16 ` Michael S. Tsirkin [this message]
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=20111010131639.GB23679@redhat.com \
--to=mst@redhat.com \
--cc=pbonzini@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 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).