public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Avi Kivity <avi@qumranet.com>, Dor Laor <dor.laor@gmail.com>
Cc: kvm-devel@lists.sourceforge.net, Marcelo Tosatti <mtosatti@redhat.com>
Subject: [patch 3/3] QEMU/KVM: notify IO thread of pending bhs
Date: Wed, 02 Apr 2008 20:20:16 -0300	[thread overview]
Message-ID: <20080402233312.289346488@localhost.localdomain> (raw)
In-Reply-To: 20080402232013.121684903@localhost.localdomain

[-- Attachment #1: qemu-bh-schedule --]
[-- Type: text/plain, Size: 1764 bytes --]

This fixes the slow vmdk issue found in the regression
tests.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

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

  parent reply	other threads:[~2008-04-02 23:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-02 23:20 [patch 0/3] separate thread for IO handling V3 Marcelo Tosatti
2008-04-02 23:20 ` [patch 1/3] QEMU/KVM: separate thread for IO handling Marcelo Tosatti
2008-04-02 23:20 ` [patch 2/3] QEMU/KVM: add function to handle signals Marcelo Tosatti
2008-04-02 23:20 ` Marcelo Tosatti [this message]
2008-04-03 10:24 ` [patch 0/3] separate thread for IO handling V3 Avi Kivity
2008-04-03 12:46   ` Avi Kivity
2008-04-03 15:26     ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080402233312.289346488@localhost.localdomain \
    --to=mtosatti@redhat.com \
    --cc=avi@qumranet.com \
    --cc=dor.laor@gmail.com \
    --cc=kvm-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox