qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mike Day <ncmike@ncultra.org>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [RFC PATCH 10/14] cpus: report RCU quiescent states
Date: Wed, 14 Aug 2013 11:50:46 -0400	[thread overview]
Message-ID: <1376495450-5133-11-git-send-email-ncmike@ncultra.org> (raw)
In-Reply-To: <1376495450-5133-1-git-send-email-ncmike@ncultra.org>

From: Paolo Bonzini <pbonzini@redhat.com>

CPU threads have extended quiescent states while relinquishing control
to the accelerator (except TCG).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Mike Day <ncmike@ncultra.org>
---
 cpus.c    | 3 +++
 kvm-all.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/cpus.c b/cpus.c
index 0f65e76..624658e 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"
@@ -818,6 +819,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg)
     while (1) {
         current_cpu = NULL;
         qemu_mutex_unlock_iothread();
+	rcu_thread_offline();
         do {
             int sig;
             r = sigwait(&waitset, &sig);
@@ -826,6 +828,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg)
             perror("sigwait");
             exit(1);
         }
+	rcu_thread_online();
         qemu_mutex_lock_iothread();
         current_cpu = cpu;
         qemu_wait_io_event_common(cpu);
diff --git a/kvm-all.c b/kvm-all.c
index 716860f..a47573d 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 */
@@ -1641,7 +1642,9 @@ int kvm_cpu_exec(CPUState *cpu)
         }
         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);
-- 
1.8.3.1

  parent reply	other threads:[~2013-08-14 15:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-14 15:50 [Qemu-devel] [RFC PATCH 00/14] RCU Implementation for Qemu Mike Day
2013-08-14 15:50 ` [Qemu-devel] [RFC PATCH 01/14] qemu-thread: add QemuEvent Mike Day
2013-08-14 15:50 ` [Qemu-devel] [RFC PATCH 02/14] rcu: add rcu library Mike Day
2013-08-14 15:50 ` [Qemu-devel] [RFC PATCH 03/14] fix #include directive for rcu header Mike Day
2013-08-14 15:50 ` [Qemu-devel] [RFC PATCH 04/14] qemu-thread: register threads with RCU Mike Day
2013-08-14 15:50 ` [Qemu-devel] [RFC PATCH 05/14] rcu: add call_rcu Mike Day
2013-08-14 15:50 ` [Qemu-devel] [RFC PATCH 06/14] rcu: add rcutorture Mike Day
2013-08-14 15:50 ` [Qemu-devel] [RFC PATCH 07/14] rcu: allow nested calls to rcu_thread_offline/rcu_thread_online Mike Day
2013-08-14 15:50 ` [Qemu-devel] [RFC PATCH 08/14] qemu-thread: report RCU quiescent states Mike Day
2013-08-14 15:50 ` [Qemu-devel] [RFC PATCH 09/14] event loop: " Mike Day
2013-08-14 15:50 ` Mike Day [this message]
2013-08-14 15:50 ` [Qemu-devel] [RFC PATCH 11/14] block: " Mike Day
2013-08-14 15:50 ` [Qemu-devel] [RFC PATCH 12/14] migration: " Mike Day
2013-08-14 15:50 ` [Qemu-devel] [PATCH 13/14] include osdep.h for definition of glue(a, b) Mike Day
2013-08-14 15:50 ` [Qemu-devel] [PATCH 14/14] fix pointer reference to rcu_assign_pointer Mike Day

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1376495450-5133-11-git-send-email-ncmike@ncultra.org \
    --to=ncmike@ncultra.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).