From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUOTi-0000dV-Dc for qemu-devel@nongnu.org; Tue, 25 Aug 2015 20:22:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUOTh-0004gb-Hl for qemu-devel@nongnu.org; Tue, 25 Aug 2015 20:22:10 -0400 Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:37458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUOTh-0004fe-Bf for qemu-devel@nongnu.org; Tue, 25 Aug 2015 20:22:09 -0400 Received: by widdq5 with SMTP id dq5so264755wid.0 for ; Tue, 25 Aug 2015 17:22:08 -0700 (PDT) Sender: Paolo Bonzini References: <55DA6D53.2080709@redhat.com> <1440463270-11819-1-git-send-email-cota@braap.org> <1440463270-11819-3-git-send-email-cota@braap.org> From: Paolo Bonzini Message-ID: <55DD06B0.5040506@redhat.com> Date: Wed, 26 Aug 2015 02:22:08 +0200 MIME-Version: 1.0 In-Reply-To: <1440463270-11819-3-git-send-email-cota@braap.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [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: "Emilio G. Cota" 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 On 25/08/2015 02:41, Emilio G. Cota wrote: > 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 It doesn't actually, see rcu_init in util/rcu.c. I'm still queueing the original patch. Paolo > --- > 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 > --