All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Avi Kivity <avi@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] QEMUFileBuffered: indicate that we're ready when the underlying file is ready
Date: Thu, 19 Aug 2010 10:19:43 -0500	[thread overview]
Message-ID: <4C6D4B8F.7080108@codemonkey.ws> (raw)
In-Reply-To: <1278521062-13795-1-git-send-email-avi@redhat.com>

On 07/07/2010 11:44 AM, Avi Kivity wrote:
> QEMUFileBuffered stops writing when the underlying QEMUFile is not ready,
> and tells its producer so.  However, when the underlying QEMUFile becomes
> ready, it neglects to pass that information along, resulting in stoppage
> of all data until the next tick (a tenths of a second).
>
> Usually this doesn't matter, because most QEMUFiles used with QEMUFileBuffered
> are almost always ready, but in the case of exec: migration this is not true,
> due to the small pipe buffers used to connect to the target process.  The
> result is very slow migration.
>
> Fix by detecting the readiness notification and propagating it.  The detection
> is a little ugly since QEMUFile overloads put_buffer() to send it, but that's
> the suject for a different patch.
>
> Signed-off-by: Avi Kivity<avi@redhat.com>\
>    

Applied.  Thanks.

Regards,

Anthony Liguori
> ---
>   buffered_file.c |    8 ++++++++
>   1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/buffered_file.c b/buffered_file.c
> index 54dc6c2..a79264f 100644
> --- a/buffered_file.c
> +++ b/buffered_file.c
> @@ -156,6 +156,14 @@ static int buffered_put_buffer(void *opaque, const uint8_t *buf, int64_t pos, in
>           offset = size;
>       }
>
> +    if (pos == 0&&  size == 0) {
> +        DPRINTF("file is ready\n");
> +        if (s->bytes_xfer<= s->xfer_limit) {
> +            DPRINTF("notifying client\n");
> +            s->put_ready(s->opaque);
> +        }
> +    }
> +
>       return offset;
>   }
>
>    

  parent reply	other threads:[~2010-08-19 15:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07 16:44 [Qemu-devel] [PATCH] QEMUFileBuffered: indicate that we're ready when the underlying file is ready Avi Kivity
2010-08-03  6:12 ` [Qemu-devel] " Avi Kivity
2010-08-03 13:00   ` Luiz Capitulino
2010-08-19 13:12     ` Avi Kivity
2010-08-19 15:19 ` Anthony Liguori [this message]
2010-08-29  9:00   ` [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=4C6D4B8F.7080108@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=avi@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.