All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] rcu: do not create thread in pthread_atfork callback
Date: Tue, 31 Mar 2015 14:55:47 +0200	[thread overview]
Message-ID: <551A9953.9080903@redhat.com> (raw)
In-Reply-To: <CAFEAcA8aXC65=7L56p1SAsOE5ixyNaJ9DzcmU++TRP41B-XFbA@mail.gmail.com>



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

  reply	other threads:[~2015-03-31 12:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31 11:01 [Qemu-devel] [PATCH] rcu: do not create thread in pthread_atfork callback Paolo Bonzini
2015-03-31 11:41 ` Peter Maydell
2015-03-31 12:55   ` Paolo Bonzini [this message]
2015-03-31 12:59     ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=551A9953.9080903@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.