Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [ltt-dev] [PATCH 6/7] urcu, call_rcu: Cleanup call_rcu_data pointers	before used in child
Date: Thu, 29 Sep 2011 15:53:59 -0400	[thread overview]
Message-ID: <20110929195359.GA12159@Krystal> (raw)
In-Reply-To: <0f645da2f35f5c974a7059655e7b2e199cf98f72.1317198301.git.laijs@cn.fujitsu.com>

Merged, with some changes:

commit 60af049d5e1d17e7ffdfd139bb486bd969c6a76c
Author: Lai Jiangshan <laijs at cn.fujitsu.com>
Date:   Thu Sep 29 15:56:43 2011 -0400

    urcu,call_rcu: Cleanup call_rcu_data pointers before use in child
    
    [ Edit by Mathieu Desnoyers: create maxcpus_reset to handle cases where
      maxcpus is 0 and -1, depending on the configuration. ]
    
    Signed-off-by: Lai Jiangshan <laijs at cn.fujitsu.com>
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>

diff --git a/urcu-call-rcu-impl.h b/urcu-call-rcu-impl.h
index d964c47..0a47d96 100644
--- a/urcu-call-rcu-impl.h
+++ b/urcu-call-rcu-impl.h
@@ -88,6 +88,11 @@ static struct call_rcu_data *default_call_rcu_data;
 static struct call_rcu_data **per_cpu_call_rcu_data;
 static long maxcpus;
 
+static void maxcpus_reset(void)
+{
+	maxcpus = 0;
+}
+
 /* Allocate the array if it has not already been allocated. */
 
 static void alloc_cpu_call_rcu_data(void)
@@ -123,6 +128,10 @@ static void alloc_cpu_call_rcu_data(void)
 static struct call_rcu_data **per_cpu_call_rcu_data = NULL;
 static const long maxcpus = -1;
 
+static void maxcpus_reset(void)
+{
+}
+
 static void alloc_cpu_call_rcu_data(void)
 {
 }
@@ -688,6 +697,12 @@ void call_rcu_after_fork_child(void)
 	default_call_rcu_data = NULL;
 	(void)get_default_call_rcu_data();
 
+	/* Cleanup call_rcu_data pointers before use */
+	maxcpus_reset();
+	free(per_cpu_call_rcu_data);
+	per_cpu_call_rcu_data = NULL;
+	thread_call_rcu_data = NULL;
+
 	/* Dispose of all of the rest of the call_rcu_data structures. */
 	cds_list_for_each_entry_safe(crdp, next, &call_rcu_data_list, list) {
 		if (crdp == default_call_rcu_data)

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com




  parent reply	other threads:[~2011-09-29 19:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-28  8:34 [ltt-dev] [PATCH 0/7] urcu,call_rcu: minior fixes, round2 Lai Jiangshan
2011-09-28  8:34 ` [ltt-dev] [PATCH 1/7] urcu, call_rcu: protects call_rcu_data_list when remove node Lai Jiangshan
2011-09-29 17:00   ` Mathieu Desnoyers
2011-09-28  8:34 ` [ltt-dev] [PATCH 2/7] urcu, defer_rcu: fix missing respond to a cancellation request Lai Jiangshan
2011-09-29 17:13   ` Mathieu Desnoyers
2011-09-28  8:34 ` [ltt-dev] [PATCH 3/7] urcu, defer_rcu: Avoid thread exit unexpected Lai Jiangshan
2011-09-29 17:27   ` Mathieu Desnoyers
2011-09-28  8:34 ` [ltt-dev] [PATCH 4/7] urcu, defer_rcu: Simplify defer_rcu() encoding Lai Jiangshan
2011-09-29 17:49   ` Mathieu Desnoyers
2011-09-28  8:34 ` [ltt-dev] [PATCH 5/7] urcu, call_rcu: avoid create call_rcu_data for child when unneed Lai Jiangshan
2011-09-29 17:27   ` Paul E. McKenney
2011-09-29 17:52     ` Mathieu Desnoyers
2011-09-28  8:34 ` [ltt-dev] [PATCH 6/7] urcu, call_rcu: Cleanup call_rcu_data pointers before used in child Lai Jiangshan
2011-09-29 17:37   ` Paul E. McKenney
2011-09-29 17:59     ` Mathieu Desnoyers
2011-09-29 18:08       ` Paul E. McKenney
2011-09-29 18:19         ` Mathieu Desnoyers
2011-09-29 18:29           ` Paul E. McKenney
2011-09-29 18:28   ` Mathieu Desnoyers
2011-09-29 19:43     ` Mathieu Desnoyers
2011-09-29 19:53   ` Mathieu Desnoyers [this message]
2011-09-28  8:34 ` [ltt-dev] [PATCH 7/7] urcu, call_rcu: Array initialized before pointer is planted Lai Jiangshan
2011-09-29 17:33   ` Paul E. McKenney
2011-09-29 20:07     ` Mathieu Desnoyers
2011-09-29 21:13       ` Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110929195359.GA12159@Krystal \
    --to=mathieu.desnoyers@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox