Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: paulmck@linux.vnet.ibm.com (Paul E. McKenney)
Subject: [ltt-dev] [PATCH RFC urcu 3/4] Allow taking address of rcu_read_lock() and rcu_read_unlock()
Date: Tue, 12 Apr 2011 20:52:14 -0700	[thread overview]
Message-ID: <1302666735-26723-3-git-send-email-paulmck@linux.vnet.ibm.com> (raw)
In-Reply-To: <20110413035110.GA26549@linux.vnet.ibm.com>

Also incorporate README feedback from Mathieu and Josh.

Signed-off-by: Paul E. McKenney <paulmck at linux.vnet.ibm.com>
---
 README      |    9 ++++++---
 urcu-bp.h   |    4 ++--
 urcu-qsbr.h |   10 +++++-----
 urcu.h      |   12 ++++++------
 4 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/README b/README
index 56e98d7..659511f 100644
--- a/README
+++ b/README
@@ -205,6 +205,9 @@ Interaction with fork()
 	rcu_bp_before_fork, rcu_bp_after_fork_parent and
 	rcu_bp_after_fork_child.
 
-	Applications that use call_rcu() are required to invoke
-	call_rcu_after_fork_child() from the child process after a
-	successful fork() system call that is not followed by exec().
+	Applications that use call_rcu() and that fork() without
+	doing an immediate exec() must take special action.  The parent
+	must invoke call_rcu_before_fork() before the fork() and
+	call_rcu_after_fork_parent() after the fork().  The child
+	process must invoke call_rcu_after_fork_child().
+	These three APIs are suitable for passing to pthread_atfork().
diff --git a/urcu-bp.h b/urcu-bp.h
index fdf885c..bc2dbc3 100644
--- a/urcu-bp.h
+++ b/urcu-bp.h
@@ -71,8 +71,8 @@ extern "C" {
  *
  * Mark the beginning and end of a read-side critical section.
  */
-#define rcu_read_lock_bp()		_rcu_read_lock()
-#define rcu_read_unlock_bp()		_rcu_read_unlock()
+#define rcu_read_lock_bp		_rcu_read_lock
+#define rcu_read_unlock_bp		_rcu_read_unlock
 
 #else /* !_LGPL_SOURCE */
 
diff --git a/urcu-qsbr.h b/urcu-qsbr.h
index 984d70c..7ef1bfe 100644
--- a/urcu-qsbr.h
+++ b/urcu-qsbr.h
@@ -67,12 +67,12 @@ extern "C" {
  * DON'T FORGET TO USE rcu_register_thread/rcu_unregister_thread()
  * FOR EACH THREAD WITH READ-SIDE CRITICAL SECTION.
  */
-#define rcu_read_lock_qsbr()		_rcu_read_lock()
-#define rcu_read_unlock_qsbr()		_rcu_read_unlock()
+#define rcu_read_lock_qsbr		_rcu_read_lock
+#define rcu_read_unlock_qsbr		_rcu_read_unlock
 
-#define rcu_quiescent_state_qsbr()	_rcu_quiescent_state()
-#define rcu_thread_offline_qsbr()	_rcu_thread_offline()
-#define rcu_thread_online_qsbr()	_rcu_thread_online()
+#define rcu_quiescent_state_qsbr	_rcu_quiescent_state
+#define rcu_thread_offline_qsbr		_rcu_thread_offline
+#define rcu_thread_online_qsbr		_rcu_thread_online
 
 #else /* !_LGPL_SOURCE */
 
diff --git a/urcu.h b/urcu.h
index 00d9b75..417e609 100644
--- a/urcu.h
+++ b/urcu.h
@@ -71,14 +71,14 @@ extern "C" {
  * READ-SIDE CRITICAL SECTION.
  */
 #ifdef RCU_MEMBARRIER
-#define rcu_read_lock_memb()		_rcu_read_lock()
-#define rcu_read_unlock_memb()		_rcu_read_unlock()
+#define rcu_read_lock_memb		_rcu_read_lock
+#define rcu_read_unlock_memb		_rcu_read_unlock
 #elif defined(RCU_SIGNAL)
-#define rcu_read_lock_sig()		_rcu_read_lock()
-#define rcu_read_unlock_sig()		_rcu_read_unlock()
+#define rcu_read_lock_sig		_rcu_read_lock
+#define rcu_read_unlock_sig		_rcu_read_unlock
 #elif defined(RCU_MB)
-#define rcu_read_lock_mb()		_rcu_read_lock()
-#define rcu_read_unlock_mb()		_rcu_read_unlock()
+#define rcu_read_lock_mb		_rcu_read_lock
+#define rcu_read_unlock_mb		_rcu_read_unlock
 #endif
 
 #else /* !_LGPL_SOURCE */
-- 
1.7.3.2





  parent reply	other threads:[~2011-04-13  3:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-13  3:51 [ltt-dev] [PATCH RFC urcu 0/2] v2 allow multiple URCU flavors in one executable Paul E. McKenney
2011-04-13  3:52 ` [ltt-dev] [PATCH RFC urcu 1/4] Provide pthread_atfork-friendly interfaces Paul E. McKenney
2011-04-13 21:21   ` Mathieu Desnoyers
2011-04-13 21:26     ` Mathieu Desnoyers
2011-04-13  3:52 ` [ltt-dev] [PATCH RFC urcu 2/4] Map symbols to allow multiple RCU flavors to be used in one binary Paul E. McKenney
2011-04-13 21:24   ` Mathieu Desnoyers
     [not found]   ` <BLU0-SMTP10190BBFDDC955B267796E196AA0@phx.gbl>
2011-04-14  0:10     ` [ltt-dev] [rp] " Paul E. McKenney
2011-04-13  3:52 ` Paul E. McKenney [this message]
2011-04-13  3:52 ` [ltt-dev] [PATCH RFC urcu 4/4] Make defer_rcu() usable from library using multiple URCU implementations Paul E. McKenney

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=1302666735-26723-3-git-send-email-paulmck@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.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