From dc1fe4244826046c29caba17b88783a8e2a549a2 Mon Sep 17 00:00:00 2001 From: Marcelo Tosatti Date: Wed, 2 Apr 2008 20:20:16 -0300 Subject: [PATCH] Notify IO thread of pending bhs This fixes the slow vmdk issue found in the regression tests. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity --- qemu-kvm.c | 6 ++++++ qemu-kvm.h | 2 ++ vl.c | 2 ++ 3 files changed, 10 insertions(+) diff --git a/qemu-kvm.c b/qemu-kvm.c index 7bf7aa3543..8b5d2dc21c 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -411,6 +411,12 @@ int kvm_init_ap(void) return 0; } +void qemu_kvm_notify_work(void) +{ + if (io_thread) + pthread_kill(io_thread, SIGUSR1); +} + /* * The IO thread has all signals that inform machine events * blocked (io_signal_table), so it won't get interrupted diff --git a/qemu-kvm.h b/qemu-kvm.h index ff9c86ef16..ae5ce1a6b4 100644 --- a/qemu-kvm.h +++ b/qemu-kvm.h @@ -60,6 +60,8 @@ void qemu_kvm_aio_wait_start(void); void qemu_kvm_aio_wait(void); void qemu_kvm_aio_wait_end(void); +void qemu_kvm_notify_work(void); + void kvm_tpr_opt_setup(); void kvm_tpr_access_report(CPUState *env, uint64_t rip, int is_write); int handle_tpr_access(void *opaque, int vcpu, diff --git a/vl.c b/vl.c index 8cb827bdfc..49d9af2949 100644 --- a/vl.c +++ b/vl.c @@ -7588,6 +7588,8 @@ void qemu_bh_schedule(QEMUBH *bh) if (env) { cpu_interrupt(env, CPU_INTERRUPT_EXIT); } + if (kvm_enabled()) + qemu_kvm_notify_work(); } void qemu_bh_cancel(QEMUBH *bh) -- 2.11.4.GIT