From patchwork Fri Jan 21 20:48:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 79939 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 EC736B7104 for ; Sat, 22 Jan 2011 08:24:19 +1100 (EST) Received: from localhost ([127.0.0.1]:41984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PgNxL-0006Lf-9d for incoming@patchwork.ozlabs.org; Fri, 21 Jan 2011 15:51:39 -0500 Received: from [140.186.70.92] (port=53074 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PgNuL-00050r-Nb for qemu-devel@nongnu.org; Fri, 21 Jan 2011 15:48:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PgNuJ-000405-GA for qemu-devel@nongnu.org; Fri, 21 Jan 2011 15:48:33 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:55703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PgNuJ-0003zl-AE for qemu-devel@nongnu.org; Fri, 21 Jan 2011 15:48:31 -0500 Received: from smtp02.web.de ( [172.20.0.184]) by fmmailgate03.web.de (Postfix) with ESMTP id 0B2A418467EED; Fri, 21 Jan 2011 21:48:30 +0100 (CET) Received: from [92.75.143.98] (helo=localhost.localdomain) by smtp02.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #2) id 1PgNuH-0007KF-03; Fri, 21 Jan 2011 21:48:30 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Date: Fri, 21 Jan 2011 21:48:20 +0100 Message-Id: X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX191roF3WUe/A8Vmxof3RFCtxWWOIFxqBQnInSAP 8utaDN6pOLgGAYHKo5rMw7UlH1C5pjGp7BoJzGy9mUhTX8hqH9 KGPKVtRjo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 16/18] 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 --- 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)) {