kvm: Do not use qemu_fair_mutex
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 21 Jan 2011 20:48:20 +0000 (21:48 +0100)
committerMarcelo Tosatti <mtosatti@redhat.com>
Sun, 23 Jan 2011 04:27:22 +0000 (02:27 -0200)
The imbalance in the hold time of qemu_global_mutex only exists in TCG
mode. In contrast to TCG VCPUs, KVM drops the global lock during guest
execution. We already avoid touching the fairness lock from the
IO-thread in KVM mode, so also stop using it from the VCPU threads.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
cpus.c

diff --git a/cpus.c b/cpus.c
index 0309189bfd69564352c8d6260e2f9592e18c8f5c..4c9928e2ce633d2f09750266771c719962a4b15c 100644 (file)
--- a/cpus.c
+++ b/cpus.c
@@ -735,9 +735,7 @@ static sigset_t block_io_signals(void)
 void qemu_mutex_lock_iothread(void)
 {
     if (kvm_enabled()) {
-        qemu_mutex_lock(&qemu_fair_mutex);
         qemu_mutex_lock(&qemu_global_mutex);
-        qemu_mutex_unlock(&qemu_fair_mutex);
     } else {
         qemu_mutex_lock(&qemu_fair_mutex);
         if (qemu_mutex_trylock(&qemu_global_mutex)) {