Message ID | 20181213050453.9677-70-cota@braap.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8E0E0112E for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 13 Dec 2018 06:00:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EBA02B634 for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 13 Dec 2018 06:00:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7352A2B938; Thu, 13 Dec 2018 06:00:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 15E9A2B93C for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 13 Dec 2018 06:00:01 +0000 (UTC) Received: from localhost ([::1]:50726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1gXK2S-0005Ox-1Q for patchwork-qemu-devel@patchwork.kernel.org; Thu, 13 Dec 2018 01:00:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <cota@braap.org>) id 1gXJD1-00084O-W4 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 00:06:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <cota@braap.org>) id 1gXJCz-0002Cj-5V for qemu-devel@nongnu.org; Thu, 13 Dec 2018 00:06:51 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:52509) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <cota@braap.org>) id 1gXJCy-0001t1-Tj for qemu-devel@nongnu.org; Thu, 13 Dec 2018 00:06:49 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B5E8921B42; Thu, 13 Dec 2018 00:05:52 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 13 Dec 2018 00:05:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h= from:to:cc:subject:date:message-id:in-reply-to:references; s= mesmtp; bh=yPhCWeq8BhzwNOxKLF9DWmKqdHixWTGLXCP6jsHYBeU=; b=iMRo4 uy97t9t0RO8kWZwmggYJkX5NuZm33+7WvW8c5S5m2uztS1stb4Zp2x7nsNt5qLaL +hcLiSqlJu9PHjIZqTU4U3+jj3VheFW/s/X4Qajrd+2iK65BIhR/e5jrhSTlaMY6 LhCCWjdYdYkPiKZh7HCYNYQgizQie5jsfxNpWA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=yPhCWeq8BhzwNOxKLF9DWmKqdHixW TGLXCP6jsHYBeU=; b=H296Vs7oPO5w3vMGf1bv5CRPvXWyYvfI3OwT9ooWnYf1z 080GK79kzkExKbzYwQNTtnu4tS3Qy9575LGVijb6TyQhtMkfJVQp/bl9ZY/ex67m EGFqqSodPk5EUBmV0gV/FATn9uN43Goc/ffKqjWlAylryR832Nf3Yw9VxeQ0Cpja HbhMNneOysC/bdKMAJewahGDirfbFZGE+0uTnqh9SpDeQAwXBXLUBqyltfDJe+SX B/ROQW8d1dYdM5aOmM1MVeciG4Bx7AmOC/kz7ThkKBmafcVt4Kd2T8DBDfOygSMV Q7VSXi2P4B1rtwCkLU95laeKgx0Lg7MvA09Bve/gw== X-ME-Sender: <xms:sOgRXPw2vRQG5ZVefdN6nWKuLrvYxu6i0C2gkPWr30bWX5aRGUkeow> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtkedrudehuddgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkof gjfhestddtredtredttdenucfhrhhomhepfdfgmhhilhhiohcuifdrucevohhtrgdfuceo tghothgrsegsrhgrrghprdhorhhgqeenucfkphepuddvkedrheelrddvtddrvdduieenuc frrghrrghmpehmrghilhhfrhhomheptghothgrsegsrhgrrghprdhorhhgnecuvehluhhs thgvrhfuihiivgepudel X-ME-Proxy: <xmx:sOgRXL2cSCTsVbqrzeziGbZZgqK4uKMF7xoZ2jT8zyu0CI2CX8_vIw> <xmx:sOgRXOwNqTOBU335bmUDzbgUvlVIIXEKBkEn_VSqpXaJKvN9jXwCMg> <xmx:sOgRXMJd-8GetQFko2zD91y6CiG1t1cqqMbM7VuzmprfC16dYTcV1A> <xmx:sOgRXBLM9JKyGOsqH0aRAwyDNeH_HsQAg9o4IO9OYTZWXKt1De8JvA> Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 55D9F1045F; Thu, 13 Dec 2018 00:05:52 -0500 (EST) From: "Emilio G. Cota" <cota@braap.org> To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 00:04:49 -0500 Message-Id: <20181213050453.9677-70-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181213050453.9677-1-cota@braap.org> References: <20181213050453.9677-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v5 69/73] cpu: rename all_cpu_threads_idle to qemu_tcg_rr_all_cpu_threads_idle X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org> Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
per-CPU locks
|
expand
|
diff --git a/cpus.c b/cpus.c index fa66d84bc7..b89d3790d7 100644 --- a/cpus.c +++ b/cpus.c @@ -211,10 +211,12 @@ static bool cpu_thread_is_idle(CPUState *cpu) return true; } -static bool all_cpu_threads_idle(void) +static bool qemu_tcg_rr_all_cpu_threads_idle(void) { CPUState *cpu; + g_assert(qemu_is_tcg_rr()); + CPU_FOREACH(cpu) { if (!cpu_thread_is_idle(cpu)) { return false; @@ -692,7 +694,7 @@ void qemu_start_warp_timer(void) } if (replay_mode != REPLAY_MODE_PLAY) { - if (!all_cpu_threads_idle()) { + if (!qemu_tcg_rr_all_cpu_threads_idle()) { return; } @@ -1325,7 +1327,7 @@ static void qemu_tcg_rr_wait_io_event(void) { CPUState *cpu; - while (all_cpu_threads_idle()) { + while (qemu_tcg_rr_all_cpu_threads_idle()) { stop_tcg_kick_timer(); qemu_cond_wait(first_cpu->halt_cond, &qemu_global_mutex); } @@ -1659,7 +1661,7 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg) atomic_mb_set(&cpu->exit_request, 0); } - if (use_icount && all_cpu_threads_idle()) { + if (use_icount && qemu_tcg_rr_all_cpu_threads_idle()) { /* * When all cpus are sleeping (e.g in WFI), to avoid a deadlock * in the main_loop, wake it up in order to start the warp timer.
This function is only called from TCG rr mode, so add a prefix to mark this as well as an assertion. Signed-off-by: Emilio G. Cota <cota@braap.org> --- cpus.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)