From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIWVG-0005ai-9h for qemu-devel@nongnu.org; Fri, 24 Jul 2015 02:30:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZIWVB-0000ay-2t for qemu-devel@nongnu.org; Fri, 24 Jul 2015 02:30:42 -0400 Received: from [59.151.112.132] (port=28797 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIWVA-0000ZH-9u for qemu-devel@nongnu.org; Fri, 24 Jul 2015 02:30:36 -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> <55B1D9B5.90901@redhat.com> From: Wen Congyang Message-ID: <55B1DB80.90005@cn.fujitsu.com> Date: Fri, 24 Jul 2015 14:30:24 +0800 MIME-Version: 1.0 In-Reply-To: <55B1D9B5.90901@redhat.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: Paolo Bonzini , Wen Congyang , Christian Borntraeger , qemu-devel@nongnu.org On 07/24/2015 02:22 PM, Paolo Bonzini wrote: > > > 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. OK, I will do it. Thanks Wen Congyang > > Paolo > . >