From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZI9Aj-0008TG-Ki for qemu-devel@nongnu.org; Thu, 23 Jul 2015 01:35:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZI9Ad-00024U-Sk for qemu-devel@nongnu.org; Thu, 23 Jul 2015 01:35:57 -0400 Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]:37594) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZI9Ad-000247-Kx for qemu-devel@nongnu.org; Thu, 23 Jul 2015 01:35:51 -0400 Received: by wibud3 with SMTP id ud3so201707019wib.0 for ; Wed, 22 Jul 2015 22:35:51 -0700 (PDT) Sender: Paolo Bonzini References: <1437574681-18362-2-git-send-email-pbonzini@redhat.com> <55B057D3.2010907@cn.fujitsu.com> From: Paolo Bonzini Message-ID: <55B07D34.3090800@redhat.com> Date: Thu, 23 Jul 2015 07:35:48 +0200 MIME-Version: 1.0 In-Reply-To: <55B057D3.2010907@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 , qemu-devel@nongnu.org On 23/07/2015 04:56, Wen Congyang wrote: >> > Otherwise, grace periods are detected too early! > We always use qemu_thread_create() in qemu. So I think we can do it like this: > wrapped_fn() > { > rcu_register_thread(); > call thread_fn() here > rcu_unregister_thread(); > } > > So we will never forget to call rcu_register_thread() when creating a new thread. That's a good idea. Would you like to propose a patch for 2.5? Then we can also use it to run the thread_atexit notifiers and avoid the bug that Peter reported for OS X. Paolo