From: Marcelo Tosatti Subject: [patch 3/3] QEMU/KVM: notify IO thread of pending bhs Date: Wed, 02 Apr 2008 20:20:16 -0300 Message-ID: <20080402233312.289346488@localhost.localdomain> References: <20080402232013.121684903@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net, Marcelo Tosatti To: Avi Kivity , Dor Laor Return-path: Content-Disposition: inline; filename=qemu-bh-schedule List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org This fixes the slow vmdk issue found in the regression tests. Signed-off-by: Marcelo Tosatti Index: kvm-userspace.io/qemu/qemu-kvm.c =================================================================== --- kvm-userspace.io.orig/qemu/qemu-kvm.c +++ kvm-userspace.io/qemu/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 Index: kvm-userspace.io/qemu/qemu-kvm.h =================================================================== --- kvm-userspace.io.orig/qemu/qemu-kvm.h +++ kvm-userspace.io/qemu/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, Index: kvm-userspace.io/qemu/vl.c =================================================================== --- kvm-userspace.io.orig/qemu/vl.c +++ kvm-userspace.io/qemu/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) -- ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace