qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RFC 10/10] cpus: Do not sleep if some work item is pending


From: Alvise Rigo
Subject: [Qemu-devel] [RFC 10/10] cpus: Do not sleep if some work item is pending
Date: Thu, 26 May 2016 18:35:49 +0200

If a VCPU returns EXCP_HALTED from the guest code execution and in the
mean time receives a work item, it will go to sleep without processing
the job.

Before sleeping, check if any work has been added.

Signed-off-by: Alvise Rigo <address@hidden>
---
 cpus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpus.c b/cpus.c
index 7bc96e2..3d19a2e 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1477,7 +1477,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
 
         handle_icount_deadline();
 
-        if (sleep) {
+        if (sleep && cpu->queued_work_first == NULL) {
             qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex);
         }
 
-- 
2.8.3




reply via email to

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