diff mbox

[v18,13/21] icount: improve counting for record/replay

Message ID 56025DE5.5040600@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Sept. 23, 2015, 8:08 a.m. UTC
On 23/09/2015 09:22, Pavel Dovgaluk wrote:
> Sometimes tcg thread halts in qemu_tcg_wait_io_event function,
> waiting for any external event. Virtual clock does not run, because
> warp is not called. warp call in main_loop_wait proceeds virtual
> clock and allows tcg thread to run further.

Ok, this makes sense!

Would this work too as a replacement for this patch?

Paolo

Comments

Pavel Dovgalyuk Sept. 23, 2015, 8:42 a.m. UTC | #1
> From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of Paolo Bonzini
> On 23/09/2015 09:22, Pavel Dovgaluk wrote:
> > Sometimes tcg thread halts in qemu_tcg_wait_io_event function,
> > waiting for any external event. Virtual clock does not run, because
> > warp is not called. warp call in main_loop_wait proceeds virtual
> > clock and allows tcg thread to run further.
> 
> Ok, this makes sense!
> 
> Would this work too as a replacement for this patch?

No, it doesn't help.
It seems that tcg is waiting within qemu_cond_wait function without leaving it.

> 
> diff --git a/cpus.c b/cpus.c
> index fbbd17f..9480acc 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -926,6 +926,7 @@ static void qemu_tcg_wait_io_event(CPUState *cpu)
>      }
> 
>      while (iothread_requesting_mutex) {
> +        qemu_clock_warp(QEMU_CLOCK_VIRTUAL);
>          qemu_cond_wait(&qemu_io_proceeded_cond, &qemu_global_mutex);
>      }


Pavel Dovgalyuk
diff mbox

Patch

diff --git a/cpus.c b/cpus.c
index fbbd17f..9480acc 100644
--- a/cpus.c
+++ b/cpus.c
@@ -926,6 +926,7 @@  static void qemu_tcg_wait_io_event(CPUState *cpu)
     }

     while (iothread_requesting_mutex) {
+        qemu_clock_warp(QEMU_CLOCK_VIRTUAL);
         qemu_cond_wait(&qemu_io_proceeded_cond, &qemu_global_mutex);
     }