From ad1b99096a48d7cbeb07991f0a4015bbbd82645d Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Thu, 29 Sep 2011 13:55:11 -0400 Subject: [PATCH] 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 --- urcu-call-rcu-impl.h | 4 ++++ 1 file changed, 4 insertions(+) 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. -- 2.34.1