[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/37] Leave inner main_loop faster on pending reque
From: |
Marcelo Tosatti |
Subject: |
[Qemu-devel] [PATCH 05/37] Leave inner main_loop faster on pending requests |
Date: |
Mon, 14 Feb 2011 13:22:34 -0200 |
From: Jan Kiszka <address@hidden>
If there is any pending request that requires us to leave the inner loop
if main_loop, makes sure we do this as soon as possible by enforcing
non-blocking IO processing.
At this change, move variable definitions out of the inner loop to
improve readability.
Signed-off-by: Jan Kiszka <address@hidden>
Signed-off-by: Marcelo Tosatti <address@hidden>
---
vl.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/vl.c b/vl.c
index 30263d6..9c628f0 100644
--- a/vl.c
+++ b/vl.c
@@ -1402,18 +1402,21 @@ qemu_irq qemu_system_powerdown;
static void main_loop(void)
{
+ bool nonblocking = false;
+#ifdef CONFIG_PROFILER
+ int64_t ti;
+#endif
int r;
qemu_main_loop_start();
for (;;) {
do {
- bool nonblocking = false;
-#ifdef CONFIG_PROFILER
- int64_t ti;
-#endif
#ifndef CONFIG_IOTHREAD
nonblocking = cpu_exec_all();
+ if (!vm_can_run()) {
+ nonblocking = true;
+ }
#endif
#ifdef CONFIG_PROFILER
ti = profile_getclock();
--
1.7.4
- [Qemu-devel] [PATCH 00/37] [PULL] qemu-kvm.git uq/master queue, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 29/37] kvm: Separate TCG from KVM cpu execution, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 05/37] Leave inner main_loop faster on pending requests,
Marcelo Tosatti <=
- [Qemu-devel] [PATCH 24/37] Refactor cpu_has_work/any_cpu_has_work in cpus.c, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 25/37] Fix a few coding style violations in cpus.c, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 32/37] kvm: x86: Catch and report failing IRQ and NMI injections, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 01/37] Prevent abortion on multiple VCPU kicks, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 18/37] Introduce VCPU self-signaling service, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 27/37] Refactor debug and vmstop request interface, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 06/37] Flatten the main loop, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 21/37] kvm: Leave kvm_cpu_exec directly after KVM_EXIT_SHUTDOWN, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 33/37] kvm: Remove unneeded memory slot reservation, Marcelo Tosatti, 2011/02/14
- [Qemu-devel] [PATCH 10/37] kvm: Provide sigbus services arch-independently, Marcelo Tosatti, 2011/02/14