[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/31] replay: notify the main loop when there are no instructions
From: |
Paolo Bonzini |
Subject: |
[PULL 06/31] replay: notify the main loop when there are no instructions |
Date: |
Wed, 24 Jun 2020 06:50:23 -0400 |
From: Pavel Dovgalyuk <Pavel.Dovgaluk@gmail.com>
When QEMU is executed in console mode without any external event sources,
main loop may sleep for a very long time. But in case of replay
there is another event source - event log.
This patch adds main loop notification when the vCPU loop has nothing
to do and main loop should process the inputs from the event log.
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Message-Id: <159013007895.28110.2020104406699709721.stgit@pasha-ThinkPad-X280>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
cpus.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/cpus.c b/cpus.c
index 7317ae06b9..41d1c5099f 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1374,6 +1374,13 @@ static int64_t tcg_get_icount_limit(void)
}
}
+static void notify_aio_contexts(void)
+{
+ /* Wake up other AioContexts. */
+ qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
+ qemu_clock_run_timers(QEMU_CLOCK_VIRTUAL);
+}
+
static void handle_icount_deadline(void)
{
assert(qemu_in_vcpu_thread());
@@ -1382,9 +1389,7 @@ static void handle_icount_deadline(void)
QEMU_TIMER_ATTR_ALL);
if (deadline == 0) {
- /* Wake up other AioContexts. */
- qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
- qemu_clock_run_timers(QEMU_CLOCK_VIRTUAL);
+ notify_aio_contexts();
}
}
}
@@ -1407,6 +1412,10 @@ static void prepare_icount_for_run(CPUState *cpu)
cpu->icount_extra = cpu->icount_budget - insns_left;
replay_mutex_lock();
+
+ if (cpu->icount_budget == 0 && replay_has_checkpoint()) {
+ notify_aio_contexts();
+ }
}
}
--
2.26.2
- [PULL 00/31] Misc patches for 2020-06-24, Paolo Bonzini, 2020/06/24
- [PULL 01/31] kvm: support to get/set dirty log initial-all-set capability, Paolo Bonzini, 2020/06/24
- [PULL 02/31] util/getauxval: Porting to FreeBSD getauxval feature, Paolo Bonzini, 2020/06/24
- [PULL 03/31] libqos: usb-hcd-ehci: use 32-bit write for config register, Paolo Bonzini, 2020/06/24
- [PULL 04/31] libqos: pci-pc: use 32-bit write for EJ register, Paolo Bonzini, 2020/06/24
- [PULL 05/31] memory: Revert "memory: accept mismatching sizes in memory_region_access_valid", Paolo Bonzini, 2020/06/24
- [PULL 06/31] replay: notify the main loop when there are no instructions,
Paolo Bonzini <=
- [PULL 09/31] exec: fetch the alignment of Linux devdax pmem character device nodes, Paolo Bonzini, 2020/06/24
- [PULL 13/31] xen: Actually fix build without passthrough, Paolo Bonzini, 2020/06/24
- [PULL 08/31] configure: add libdaxctl support, Paolo Bonzini, 2020/06/24
- [PULL 10/31] docs/nvdimm: add description of alignment requirement of device dax, Paolo Bonzini, 2020/06/24
- [PULL 11/31] hw/scsi/megasas: Fix possible out-of-bounds array access in tracepoints, Paolo Bonzini, 2020/06/24
- [PULL 15/31] softfloat: merge floatx80_mod and floatx80_rem, Paolo Bonzini, 2020/06/24
- [PULL 16/31] softfloat: fix floatx80 remainder pseudo-denormal check for zero, Paolo Bonzini, 2020/06/24
- [PULL 18/31] softfloat: do not set denominator high bit for floatx80 remainder, Paolo Bonzini, 2020/06/24
- [PULL 12/31] Makefile: Install qemu-[qmp/ga]-ref.* into the directory "interop", Paolo Bonzini, 2020/06/24
- [PULL 14/31] target/i386: reimplement f2xm1 using floatx80 operations, Paolo Bonzini, 2020/06/24