On 24/07/2015 07:56, Wen Congyang wrote: > @@ -115,9 +116,12 @@ static void wait_for_readers(void) > } > > /* Wait for one thread to report a quiescent state and > - * try again. > + * try again. Release rcu_gp_lock, so rcu_(un)register_thread() > + * doesn't wait too much time. > */ > + qemu_mutex_unlock(&rcu_gp_lock); > qemu_event_wait(&rcu_gp_event); > + qemu_mutex_lock(&rcu_gp_lock); > } >
So in this case rcu_unregister_thread could actually remove the node from synchronize_rcu's qsreaders, not just from registry. That's a bit tricky, but it should work. Please add a comment, however. Also, please rename "rcu_gp_lock" as well to rcu_registry_lock. We'll get the patches in QEMU 2.5. Paolo