From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZU2IH-0003yf-FJ for qemu-devel@nongnu.org; Mon, 24 Aug 2015 20:40:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZU2IE-0005w3-Bo for qemu-devel@nongnu.org; Mon, 24 Aug 2015 20:40:53 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:52111) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZU2IE-0005vQ-8m for qemu-devel@nongnu.org; Mon, 24 Aug 2015 20:40:50 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id EEEFB20BD1 for ; Mon, 24 Aug 2015 20:40:48 -0400 (EDT) From: "Emilio G. Cota" Date: Mon, 24 Aug 2015 20:41:09 -0400 Message-Id: <1440463270-11819-3-git-send-email-cota@braap.org> In-Reply-To: <1440463270-11819-1-git-send-email-cota@braap.org> References: <55DA6D53.2080709@redhat.com> <1440463270-11819-1-git-send-email-cota@braap.org> Subject: [Qemu-devel] [PATCH 3/4] linux-user: call rcu_(un)register_thread on thread creation/deletion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: pbonzini@redhat.com Cc: mttcg@listserver.greensocs.com, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, qemu-devel@nongnu.org, guillaume.delbergue@greensocs.com, alex.bennee@linaro.org, Frederic Konrad Note that the right place to call rcu_register_thread() is do_cpu_loop() and not just in clone_func(), since the original 'main' thread needs to call rcu_register_thread() as well. Signed-off-by: Emilio G. Cota --- linux-user/qemu.h | 1 + linux-user/syscall.c | 1 + 2 files changed, 2 insertions(+) diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 8af5e01..08e6609 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -203,6 +203,7 @@ void fork_end(int child); static inline void do_cpu_loop(CPUArchState *env) { + rcu_register_thread(); current_cpu = ENV_GET_CPU(env); cpu_loop(env); } diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 701c8fa..84909b4 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5614,6 +5614,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, thread_cpu = NULL; object_unref(OBJECT(cpu)); g_free(ts); + rcu_unregister_thread(); pthread_exit(NULL); } #ifdef TARGET_GPROF -- 1.9.1