From mboxrd@z Thu Jan 1 00:00:00 1970 From: paulmck@linux.vnet.ibm.com (Paul E. McKenney) Date: Mon, 4 Apr 2011 21:11:27 -0700 Subject: [ltt-dev] [rp] [PATCH RFC urcu 1/2] Provide pthread_atfork-friendly interfaces In-Reply-To: References: <20110323183635.GA21074@linux.vnet.ibm.com> <1300905482-21272-1-git-send-email-paulmck@linux.vnet.ibm.com> Message-ID: <20110405041127.GB3125@linux.vnet.ibm.com> On Fri, Apr 01, 2011 at 04:52:50PM -0400, Mathieu Desnoyers wrote: > * Paul E. McKenney (paulmck at linux.vnet.ibm.com) wrote: > > Provides call_rcu_before_fork() and call_rcu_after_fork_parent() to > > go with the existing call_rcu_after_fork_child(). > > > > Signed-off-by: Paul E. McKenney > > --- > > README | 4 ++++ > > urcu-call-rcu.c | 29 ++++++++++++++++++++++++++++- > > 2 files changed, 32 insertions(+), 1 deletions(-) > > > > diff --git a/README b/README > > index f7f0dec..56e98d7 100644 > > --- a/README > > +++ b/README > > @@ -204,3 +204,7 @@ Interaction with fork() > > liburcu-bp, which is designed to handle fork() by calling > > rcu_bp_before_fork, rcu_bp_after_fork_parent and > > rcu_bp_after_fork_child. > > + > > + Applications that use call_rcu() are required to invoke > > + call_rcu_after_fork_child() from the child process after a > > + successful fork() system call that is not followed by exec(). > > Should you say something about the before hook, and after hook in the > parent too ? Good point, fixed as follows: diff --git a/README b/README index 56e98d7..3e23120 100644 --- a/README +++ b/README @@ -205,6 +205,8 @@ Interaction with fork() rcu_bp_before_fork, rcu_bp_after_fork_parent and rcu_bp_after_fork_child. - Applications that use call_rcu() are required to invoke - call_rcu_after_fork_child() from the child process after a - successful fork() system call that is not followed by exec(). + Applications that use call_rcu() and that fork() without + doing an immediate exec() must take special action. The parent + must invoke call_rcu_before_fork() before the fork() and + call_rcu_after_fork_parent() after the fork(). The child + process must invoke call_rcu_after_fork_child().