From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycvi3-0005tb-VO for qemu-devel@nongnu.org; Tue, 31 Mar 2015 08:56:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ycvhz-0004LI-7f for qemu-devel@nongnu.org; Tue, 31 Mar 2015 08:55:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycvhz-0004LA-0K for qemu-devel@nongnu.org; Tue, 31 Mar 2015 08:55:55 -0400 Message-ID: <551A9953.9080903@redhat.com> Date: Tue, 31 Mar 2015 14:55:47 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1427799701-31563-1-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] rcu: do not create thread in pthread_atfork callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , "Dr. David Alan Gilbert" On 31/03/2015 13:41, Peter Maydell wrote: >> > static void __attribute__((__constructor__)) rcu_init(void) >> > { >> > #ifdef CONFIG_POSIX >> > - pthread_atfork(rcu_init_lock, rcu_init_unlock, rcu_init_child); >> > + pthread_atfork(rcu_init_lock, rcu_init_unlock, rcu_init_unlock); >> > #endif >> > rcu_init_complete(); >> > } > So this is changing the linux-user behaviour so we no > longer do any init after fork; is that a problem? Currently linux-user is not using RCU at all, so no. Should I add an rcu_after_fork there too? diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 4bd9543..1622ad6 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4572,6 +4572,7 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp, ret = fork(); if (ret == 0) { /* Child Process. */ + rcu_after_fork(); cpu_clone_regs(env, newsp); fork_end(1); /* There is a race condition here. The parent process could Paolo