From: Lai Jiangshan Date: Thu, 29 Sep 2011 17:55:11 +0000 (-0400) Subject: urcu,call_rcu: avoid create call_rcu_data for child when unneed X-Git-Tag: v0.6.5~5 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ad1b99096a48d7cbeb07991f0a4015bbbd82645d;p=urcu.git urcu,call_rcu: avoid create call_rcu_data for child when unneed Signed-off-by: Lai Jiangshan Reviewed-by: Paul E. McKenney Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu-call-rcu-impl.h b/urcu-call-rcu-impl.h index d5b75c0..d964c47 100644 --- a/urcu-call-rcu-impl.h +++ b/urcu-call-rcu-impl.h @@ -677,6 +677,10 @@ void call_rcu_after_fork_child(void) /* Release the mutex. */ call_rcu_unlock(&call_rcu_mutex); + /* Do nothing when call_rcu() has not been used */ + if (cds_list_empty(&call_rcu_data_list)) + return; + /* * Allocate a new default call_rcu_data structure in order * to get a working call_rcu thread to go with it.