From patchwork Thu Jan 6 17:56:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 77769 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BA605B70D6 for ; Fri, 7 Jan 2011 05:29:55 +1100 (EST) Received: from localhost ([127.0.0.1]:51152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pauat-000187-Rm for incoming@patchwork.ozlabs.org; Thu, 06 Jan 2011 13:29:51 -0500 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 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p06I3IW0021192 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 6 Jan 2011 13:03:18 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p06I3Ipd014262; Thu, 6 Jan 2011 13:03:18 -0500 Received: from amt.cnet (vpn1-4-164.ams2.redhat.com [10.36.4.164]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p06I3G7E019147; Thu, 6 Jan 2011 13:03:17 -0500 Received: from amt.cnet (localhost.localdomain [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 56C9E68A279; Thu, 6 Jan 2011 15:59:46 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id p06HxgR9011410; Thu, 6 Jan 2011 15:59:42 -0200 From: Marcelo Tosatti To: Anthony Liguori Date: Thu, 6 Jan 2011 15:56:39 -0200 Message-Id: <145a38625ef39ff450f7bdca5c8be736fa302d19.1294336601.git.mtosatti@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 33/35] kvm: Do not use qemu_fair_mutex X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.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)) {