Patchwork [v2,05/24] Trigger exit from cpu_exec_all on pending IO events

login
register
mail settings
Submitter Jan Kiszka
Date Feb. 1, 2011, 9:15 p.m.
Message ID <211f12c3ce0415b57e0a9774a9499d272502984b.1296594961.git.jan.kiszka@web.de>
Download mbox | patch
Permalink /patch/81385/
State New
Headers show

Comments

Jan Kiszka - Feb. 1, 2011, 9:15 p.m.
From: Jan Kiszka <jan.kiszka@siemens.com>

Except for timer events, we currently do not leave the loop over all
VCPUs if an IO event was filed. That may cause unexpected IO latencies
under !CONFIG_IOTHREAD in SMP scenarios. Fix it by setting the global
exit_request which breaks the loop.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 cpus.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Patch

diff --git a/cpus.c b/cpus.c
index ceb3a83..5dfc54e 100644
--- a/cpus.c
+++ b/cpus.c
@@ -315,6 +315,7 @@  void qemu_notify_event(void)
     if (next_cpu && env != next_cpu) {
         cpu_exit(next_cpu);
     }
+    exit_request = 1;
 }
 
 void qemu_mutex_lock_iothread(void) {}