From patchwork Wed May 15 15:48:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 244122 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1ACD42C007B for ; Thu, 16 May 2013 01:55:07 +1000 (EST) Received: from localhost ([::1]:36509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uce2j-0008H9-BB for incoming@patchwork.ozlabs.org; Wed, 15 May 2013 11:55:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcdxV-0008Bm-Av for qemu-devel@nongnu.org; Wed, 15 May 2013 11:49:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcdxJ-0000KB-9B for qemu-devel@nongnu.org; Wed, 15 May 2013 11:49:41 -0400 Received: from mail-we0-x22e.google.com ([2a00:1450:400c:c03::22e]:45976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcdxI-0000Is-VH for qemu-devel@nongnu.org; Wed, 15 May 2013 11:49:29 -0400 Received: by mail-we0-f174.google.com with SMTP id x53so1701423wes.33 for ; Wed, 15 May 2013 08:49:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=NvHPCAr80i41mbENz0ZmLAv9k87YUiGfWsqG4pIGFJ4=; b=CVJ0cfgW6t/F8Lq4H+24dLi+MCGbpwixYW0gUMPsHixLzaABf2DCm5JJKUKSI8bDMT KsSUCFgsrUJx/8XBCV6NWY3tyVYB7GEIRmQFLV4hegbCfsxfW9sUBo63kYd9SATTLnpY nysEGt/cLkJcwL6JjcLHRVzCbnA+a/WLsdvF5kfiOYqO2Fvpsxa3qYaZyC1H9iEa4KBG BYiAtsyBAdbv//fFlOIzSOpNYLTpsVJ5CpfBMhGXoGdRMie+hcsnSe5Q9PeyWUjSgHeL GxhsKNNgAYR5Mps+Sn7RFrhei5Sm3KROLaaLUF4bAPlt3IDQcmKP9VGnIMfNBHn7mNWC TEpA== X-Received: by 10.180.37.243 with SMTP id b19mr15658875wik.12.1368632966959; Wed, 15 May 2013 08:49:26 -0700 (PDT) Received: from playground.lan (net-2-35-204-156.cust.dsl.vodafone.it. [2.35.204.156]) by mx.google.com with ESMTPSA id e5sm3152363wiy.5.2013.05.15.08.49.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 15 May 2013 08:49:26 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 15 May 2013 17:48:55 +0200 Message-Id: <1368632937-32272-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1368632937-32272-1-git-send-email-pbonzini@redhat.com> References: <1368632937-32272-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::22e Cc: Jan Kiszka , qemulist@gmail.com, David Gibson Subject: [Qemu-devel] [PATCH 10/12] cpus: report RCU quiescent states X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org CPU threads have extended quiescent states while relinquishing control to the accelerator (except TCG). Signed-off-by: Paolo Bonzini --- cpus.c | 3 +++ kvm-all.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cpus.c b/cpus.c index c232265..66970d6 100644 --- a/cpus.c +++ b/cpus.c @@ -37,6 +37,7 @@ #include "sysemu/qtest.h" #include "qemu/main-loop.h" #include "qemu/bitmap.h" +#include "qemu/rcu.h" #ifndef _WIN32 #include "qemu/compatfd.h" @@ -793,6 +794,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg) while (1) { cpu_single_env = NULL; qemu_mutex_unlock_iothread(); + rcu_thread_offline(); do { int sig; r = sigwait(&waitset, &sig); @@ -801,6 +803,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg) perror("sigwait"); exit(1); } + rcu_thread_online(); qemu_mutex_lock_iothread(); cpu_single_env = env; qemu_wait_io_event_common(cpu); diff --git a/kvm-all.c b/kvm-all.c index 8222729..6f952ac 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -33,6 +33,7 @@ #include "exec/memory.h" #include "exec/address-spaces.h" #include "qemu/event_notifier.h" +#include "qemu/rcu.h" #include "trace.h" /* This check must be after config-host.h is included */ @@ -1611,7 +1612,9 @@ int kvm_cpu_exec(CPUArchState *env) } qemu_mutex_unlock_iothread(); + rcu_thread_offline(); run_ret = kvm_vcpu_ioctl(cpu, KVM_RUN, 0); + rcu_thread_online(); qemu_mutex_lock_iothread(); kvm_arch_post_run(cpu, run);