From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIWNh-0002tD-Sa for qemu-devel@nongnu.org; Fri, 24 Jul 2015 02:22:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZIWNe-0004w7-LH for qemu-devel@nongnu.org; Fri, 24 Jul 2015 02:22:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIWNe-0004vl-G0 for qemu-devel@nongnu.org; Fri, 24 Jul 2015 02:22:50 -0400 References: <1437574681-18362-2-git-send-email-pbonzini@redhat.com> <55B0C24C.7020401@de.ibm.com> <55B0C527.8060502@redhat.com> <55B0CA2D.3060506@cn.fujitsu.com> <55B0CB47.2070301@redhat.com> <55B0E522.1000009@gmail.com> <55B11D26.10402@redhat.com> <55B1D380.7020300@cn.fujitsu.com> From: Paolo Bonzini Message-ID: <55B1D9B5.90901@redhat.com> Date: Fri, 24 Jul 2015 08:22:45 +0200 MIME-Version: 1.0 In-Reply-To: <55B1D380.7020300@cn.fujitsu.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] rcu: actually register threads that have RCU read-side critical sections List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wen Congyang , Wen Congyang , Christian Borntraeger , qemu-devel@nongnu.org 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