From mboxrd@z Thu Jan 1 00:00:00 1970 From: laijs@cn.fujitsu.com (Lai Jiangshan) Date: Wed, 28 Sep 2011 16:34:33 +0800 Subject: [ltt-dev] [PATCH 7/7] urcu, call_rcu: Array initialized before pointer is planted In-Reply-To: References: Message-ID: <78bc30a7c083ea5fb41ac3b53d305490d9361752.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 3c68ae7..462139a 100644 --- a/urcu-call-rcu-impl.h +++ b/urcu-call-rcu-impl.h @@ -104,6 +104,10 @@ static void alloc_cpu_call_rcu_data(void) p = malloc(maxcpus * sizeof(*per_cpu_call_rcu_data)); if (p != NULL) { memset(p, '\0', maxcpus * sizeof(*per_cpu_call_rcu_data)); + + /* Array initialized before pointer is planted. */ + cmm_smp_mb(); + per_cpu_call_rcu_data = p; } else { if (!warned) { -- 1.7.4.4