qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] replay: check other timers for icount limit


From: Pavel Dovgalyuk
Subject: [PATCH] replay: check other timers for icount limit
Date: Thu, 19 Dec 2019 15:46:28 +0300
User-agent: StGit/0.17.1-dirty

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 <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]