qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] QEMUFileBuffered: indicate that we're ready when the underlying file is ready
@ 2010-07-07 16:44 Avi Kivity
  2010-08-03  6:12 ` [Qemu-devel] " Avi Kivity
  2010-08-19 15:19 ` [Qemu-devel] " Anthony Liguori
  0 siblings, 2 replies; 6+ messages in thread
From: Avi Kivity @ 2010-07-07 16:44 UTC (permalink / raw)
  To: Anthony Liguori, qemu-devel

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>
---
 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;
 }
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] Re: [PATCH] QEMUFileBuffered: indicate that we're ready when the underlying file is ready
  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 ` Avi Kivity
  2010-08-03 13:00   ` Luiz Capitulino
  2010-08-19 15:19 ` [Qemu-devel] " Anthony Liguori
  1 sibling, 1 reply; 6+ messages in thread
From: Avi Kivity @ 2010-08-03  6:12 UTC (permalink / raw)
  To: Anthony Liguori, qemu-devel

  On 07/07/2010 07:44 PM, 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.

Ping.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Re: [PATCH] QEMUFileBuffered: indicate that we're ready when the underlying file is ready
  2010-08-03  6:12 ` [Qemu-devel] " Avi Kivity
@ 2010-08-03 13:00   ` Luiz Capitulino
  2010-08-19 13:12     ` Avi Kivity
  0 siblings, 1 reply; 6+ messages in thread
From: Luiz Capitulino @ 2010-08-03 13:00 UTC (permalink / raw)
  To: Avi Kivity; +Cc: qemu-devel

On Tue, 03 Aug 2010 09:12:52 +0300
Avi Kivity <avi@redhat.com> wrote:

>   On 07/07/2010 07:44 PM, 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.
> 
> Ping.

I've queued this fix and another one in a 'for-0.13' branch and was planning
to send a pull request as soon as Anthony called for 0.13 fixes, however
this didn't happen yet and I forgot.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Re: [PATCH] QEMUFileBuffered: indicate that we're ready when the underlying file is ready
  2010-08-03 13:00   ` Luiz Capitulino
@ 2010-08-19 13:12     ` Avi Kivity
  0 siblings, 0 replies; 6+ messages in thread
From: Avi Kivity @ 2010-08-19 13:12 UTC (permalink / raw)
  To: Luiz Capitulino; +Cc: qemu-devel

  On 08/03/2010 04:00 PM, Luiz Capitulino wrote:
> On Tue, 03 Aug 2010 09:12:52 +0300
> Avi Kivity<avi@redhat.com>  wrote:
>
>>    On 07/07/2010 07:44 PM, 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.
>> Ping.
> I've queued this fix and another one in a 'for-0.13' branch and was planning
> to send a pull request as soon as Anthony called for 0.13 fixes, however
> this didn't happen yet and I forgot.

Ping again.

I don't want to take over Cam's longest-time-to-apply record, so someone 
apply this please.  0.13 and mainline.

-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] QEMUFileBuffered: indicate that we're ready when the underlying file is ready
  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-19 15:19 ` Anthony Liguori
  2010-08-29  9:00   ` Avi Kivity
  1 sibling, 1 reply; 6+ messages in thread
From: Anthony Liguori @ 2010-08-19 15:19 UTC (permalink / raw)
  To: Avi Kivity; +Cc: qemu-devel

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;
>   }
>
>    

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] QEMUFileBuffered: indicate that we're ready when the underlying file is ready
  2010-08-19 15:19 ` [Qemu-devel] " Anthony Liguori
@ 2010-08-29  9:00   ` Avi Kivity
  0 siblings, 0 replies; 6+ messages in thread
From: Avi Kivity @ 2010-08-29  9:00 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel

  On 08/19/2010 06:19 PM, Anthony Liguori wrote:
> 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.

Should be applied to stable-0.13 as well.

-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-08-29  9:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [Qemu-devel] " Anthony Liguori
2010-08-29  9:00   ` Avi Kivity

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).