kvm: Do not use qemu_fair_mutex

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>
This commit is contained in:
Jan Kiszka 2011-01-21 21:48:20 +01:00 committed by Marcelo Tosatti
parent b0c883b5e0
commit b66042c722

2
cpus.c
View File

@ -735,9 +735,7 @@ static sigset_t block_io_signals(void)
void qemu_mutex_lock_iothread(void) void qemu_mutex_lock_iothread(void)
{ {
if (kvm_enabled()) { if (kvm_enabled()) {
qemu_mutex_lock(&qemu_fair_mutex);
qemu_mutex_lock(&qemu_global_mutex); qemu_mutex_lock(&qemu_global_mutex);
qemu_mutex_unlock(&qemu_fair_mutex);
} else { } else {
qemu_mutex_lock(&qemu_fair_mutex); qemu_mutex_lock(&qemu_fair_mutex);
if (qemu_mutex_trylock(&qemu_global_mutex)) { if (qemu_mutex_trylock(&qemu_global_mutex)) {