Patchwork [10/12] cpus: report RCU quiescent states

login
register
mail settings
Submitter Paolo Bonzini
Date May 15, 2013, 3:48 p.m.
Message ID <1368632937-32272-11-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/244122/
State New
Headers show

Comments

Paolo Bonzini - May 15, 2013, 3:48 p.m.
CPU threads have extended quiescent states while relinquishing control
to the accelerator (except TCG).

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

Patch

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);