[ltt-dev] [PATCH 2/3] add rcu_thread_offline before rcu_unregister_thread

Paolo Bonzini pbonzini at redhat.com
Sat Feb 27 10:57:05 EST 2010


As mentioned in the previous commit message, rcu_thread_offline
is useful to avoid deadlocks between rcu_unregister_thread and
synchronize_rcu.  Just like in urcu-qsbr.c, put a thread offline
before it unregisters itself.

An additional benefit is that a thread can unregister itself and
register itself later without triggering the assertion in
rcu_register_thread().

Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
 urcu.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/urcu.c b/urcu.c
index dee8b59..e82bf6c 100644
--- a/urcu.c
+++ b/urcu.c
@@ -383,6 +383,7 @@ void rcu_register_thread(void)
 
 void rcu_unregister_thread(void)
 {
+	_rcu_thread_offline();
 	mutex_lock(&rcu_gp_lock);
 	list_del(&rcu_reader.head);
 	mutex_unlock(&rcu_gp_lock);
-- 
1.6.6






More information about the lttng-dev mailing list