From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: [PATCH 33/35] kvm: Do not use qemu_fair_mutex Date: Thu, 6 Jan 2011 15:56:39 -0200 Message-ID: <145a38625ef39ff450f7bdca5c8be736fa302d19.1294336601.git.mtosatti@redhat.com> References: Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Jan Kiszka , Marcelo Tosatti To: Anthony Liguori Return-path: Received: from mx1.redhat.com ([209.132.183.28]:32594 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752085Ab1AFSDc (ORCPT ); Thu, 6 Jan 2011 13:03:32 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: From: Jan Kiszka 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 Signed-off-by: Marcelo Tosatti --- cpus.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index 0309189..4c9928e 100644 --- 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)) { -- 1.7.2.3 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=32966 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PauBK-0003yk-GC for qemu-devel@nongnu.org; Thu, 06 Jan 2011 13:03:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PauBD-0006eH-OU for qemu-devel@nongnu.org; Thu, 06 Jan 2011 13:03:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PauBD-0006dR-Fk for qemu-devel@nongnu.org; Thu, 06 Jan 2011 13:03:19 -0500 From: Marcelo Tosatti Date: Thu, 6 Jan 2011 15:56:39 -0200 Message-Id: <145a38625ef39ff450f7bdca5c8be736fa302d19.1294336601.git.mtosatti@redhat.com> In-Reply-To: References: Subject: [Qemu-devel] [PATCH 33/35] kvm: Do not use qemu_fair_mutex List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org From: Jan Kiszka 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 Signed-off-by: Marcelo Tosatti --- cpus.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index 0309189..4c9928e 100644 --- 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)) { -- 1.7.2.3