All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] replay: check other timers for icount limit
@ 2019-12-19 12:46 Pavel Dovgalyuk
  2019-12-20 13:14 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Dovgalyuk @ 2019-12-19 12:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, dovgaluk, pavel.dovgaluk, rth

Record/replay can stall when there are no virtual devices that generate
events - it just uses all the time for vCPU thread. Therefore main loop
has to wait too much for the vCPU thread, because they are synchronized
in rr mode.
This patch does not let creating too long vCPU executions without
interrupting to main loop. It checks realtime timers that always exits
to control user input.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
---
 cpus.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cpus.c b/cpus.c
index 63bda152f5..7dba4fa414 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1388,6 +1388,10 @@ static int64_t tcg_get_icount_limit(void)
          */
         deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
                                               QEMU_TIMER_ATTR_ALL);
+        /* Check realtime timers, because they help with input processing */
+        deadline = qemu_soonest_timeout(deadline,
+                qemu_clock_deadline_ns_all(QEMU_CLOCK_REALTIME,
+                                           QEMU_TIMER_ATTR_ALL));
 
         /* Maintain prior (possibly buggy) behaviour where if no deadline
          * was set (as there is no QEMU_CLOCK_VIRTUAL timer) or it is more than



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

* Re: [PATCH] replay: check other timers for icount limit
  2019-12-19 12:46 [PATCH] replay: check other timers for icount limit Pavel Dovgalyuk
@ 2019-12-20 13:14 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2019-12-20 13:14 UTC (permalink / raw)
  To: Pavel Dovgalyuk, qemu-devel; +Cc: dovgaluk, pavel.dovgaluk, rth

On 19/12/19 13:46, Pavel Dovgalyuk wrote:
> Record/replay can stall when there are no virtual devices that generate
> events - it just uses all the time for vCPU thread. Therefore main loop
> has to wait too much for the vCPU thread, because they are synchronized
> in rr mode.
> This patch does not let creating too long vCPU executions without
> interrupting to main loop. It checks realtime timers that always exits
> to control user input.
> 
> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
> ---
>  cpus.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/cpus.c b/cpus.c
> index 63bda152f5..7dba4fa414 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -1388,6 +1388,10 @@ static int64_t tcg_get_icount_limit(void)
>           */
>          deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
>                                                QEMU_TIMER_ATTR_ALL);
> +        /* Check realtime timers, because they help with input processing */
> +        deadline = qemu_soonest_timeout(deadline,
> +                qemu_clock_deadline_ns_all(QEMU_CLOCK_REALTIME,
> +                                           QEMU_TIMER_ATTR_ALL));
>  
>          /* Maintain prior (possibly buggy) behaviour where if no deadline
>           * was set (as there is no QEMU_CLOCK_VIRTUAL timer) or it is more than
> 

Queued, thanks.

Paolo



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

end of thread, other threads:[~2019-12-20 13:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-19 12:46 [PATCH] replay: check other timers for icount limit Pavel Dovgalyuk
2019-12-20 13:14 ` Paolo Bonzini

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.