qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC PATCH 10/14] cpus: report RCU quiescent states


From: Mike Day
Subject: [Qemu-devel] [RFC PATCH 10/14] cpus: report RCU quiescent states
Date: Wed, 14 Aug 2013 11:50:46 -0400

From: Paolo Bonzini <address@hidden>

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

Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Mike Day <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]