From mboxrd@z Thu Jan 1 00:00:00 1970 From: laijs@cn.fujitsu.com (Lai Jiangshan) Date: Wed, 28 Sep 2011 16:34:31 +0800 Subject: [ltt-dev] [PATCH 5/7] urcu, call_rcu: avoid create call_rcu_data for child when unneed In-Reply-To: References: Message-ID: <061a717cef1fd918d0a2a95b142e51a2c5a85ff5.1317198301.git.laijs@cn.fujitsu.com> Signed-off-by: Lai Jiangshan --- urcu-call-rcu-impl.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/urcu-call-rcu-impl.h b/urcu-call-rcu-impl.h index 87d9157..65c1c7a 100644 --- a/urcu-call-rcu-impl.h +++ b/urcu-call-rcu-impl.h @@ -675,6 +675,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. -- 1.7.4.4