[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/23] Leave inner main_loop faster on pending reque
From: |
Marcelo Tosatti |
Subject: |
[Qemu-devel] [PATCH 05/23] Leave inner main_loop faster on pending requests |
Date: |
Fri, 4 Feb 2011 13:47:08 -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 57b4c9f..6aa896c 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.2.3
- [Qemu-devel] [PATCH 07/23] kvm: Report proper error on GET_VCPU_MMAP_SIZE failures, (continued)
- [Qemu-devel] [PATCH 07/23] kvm: Report proper error on GET_VCPU_MMAP_SIZE failures, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 23/23] kvm: make tsc stable over migration and machine start, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 13/23] kvm: Refactor qemu_kvm_eat_signals, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 21/23] kvm: Leave kvm_cpu_exec directly after KVM_EXIT_SHUTDOWN, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 22/23] x86: Fix MCA broadcast parameters for TCG case, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 08/23] kvm: Drop redundant kvm_enabled from kvm_cpu_thread_fn, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 16/23] kvm: Fix race between timer signals and vcpu entry under !IOTHREAD, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 02/23] Stop current VCPU on synchronous reset requests, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 05/23] Leave inner main_loop faster on pending requests,
Marcelo Tosatti <=
- [Qemu-devel] [PATCH 20/23] kvm: Remove static return code of kvm_handle_io, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 10/23] kvm: Provide sigbus services arch-independently, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 15/23] Set up signalfd under !CONFIG_IOTHREAD, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 12/23] kvm: Set up signal mask also for !CONFIG_IOTHREAD, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 06/23] Flatten the main loop, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 01/23] Prevent abortion on multiple VCPU kicks, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 04/23] Trigger exit from cpu_exec_all on pending IO events, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 14/23] kvm: Call qemu_kvm_eat_signals also under !CONFIG_IOTHREAD, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 09/23] kvm: Handle kvm_init_vcpu errors, Marcelo Tosatti, 2011/02/04
- [Qemu-devel] [PATCH 03/23] Process vmstop requests in IO thread, Marcelo Tosatti, 2011/02/04