Re: [PATCH] Markers use rcu_read_lock_sched()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mathieu Desnoyers
Date: Monday, September 29, 2008 - 8:08 am

Use the new rcu_read_lock_sched/unlock_sched() in marker code around the call
site instead of preempt_disable/enable(). It helps reviewing the code more
easily.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
CC: Ingo Molnar <mingo@elte.hu>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Paul E McKenney <paulmck@linux.vnet.ibm.com>
CC: akpm@linux-foundation.org
---
 kernel/marker.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Index: linux-2.6-lttng/kernel/marker.c
===================================================================
--- linux-2.6-lttng.orig/kernel/marker.c	2008-07-15 15:21:04.000000000 -0400
+++ linux-2.6-lttng/kernel/marker.c	2008-07-15 15:21:12.000000000 -0400
@@ -105,11 +105,11 @@ void marker_probe_cb(const struct marker
 	char ptype;
 
 	/*
-	 * preempt_disable does two things : disabling preemption to make sure
-	 * the teardown of the callbacks can be done correctly when they are in
-	 * modules and they insure RCU read coherency.
+	 * rcu_read_lock_sched does two things : disabling preemption to make
+	 * sure the teardown of the callbacks can be done correctly when they
+	 * are in modules and they insure RCU read coherency.
 	 */
-	preempt_disable();
+	rcu_read_lock_sched();
 	ptype = mdata->ptype;
 	if (likely(!ptype)) {
 		marker_probe_func *func;
@@ -146,7 +146,7 @@ void marker_probe_cb(const struct marker
 			va_end(args);
 		}
 	}
-	preempt_enable();
+	rcu_read_unlock_sched();
 }
 EXPORT_SYMBOL_GPL(marker_probe_cb);
 
@@ -165,7 +165,7 @@ void marker_probe_cb_noarg(const struct 
 	va_list args;	/* not initialized */
 	char ptype;
 
-	preempt_disable();
+	rcu_read_lock_sched();
 	ptype = mdata->ptype;
 	if (likely(!ptype)) {
 		marker_probe_func *func;
@@ -197,7 +197,7 @@ void marker_probe_cb_noarg(const struct 
 			multi[i].func(multi[i].probe_private, call_private, fmt,
 				&args);
 	}
-	preempt_enable();
+	rcu_read_unlock_sched();
 }
 EXPORT_SYMBOL_GPL(marker_probe_cb_noarg);
 
@@ -562,7 +562,7 @@ static int set_marker(struct marker_entr
  * Disable a marker and its probe callback.
  * Note: only waiting an RCU period after setting elem->call to the empty
  * function insures that the original callback is not used anymore. This insured
- * by preempt_disable around the call site.
+ * by rcu_read_lock_sched around the call site.
  */
 static void disable_marker(struct marker *elem)
 {
-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] markers: fix unregister bug and reenter bug, Lai Jiangshan, (Mon Sep 29, 1:00 am)
Re: [PATCH] markers: fix unregister bug and reenter bug, Mathieu Desnoyers, (Mon Sep 29, 8:03 am)
Re: [PATCH] markers: fix unregister bug and reenter bug, Mathieu Desnoyers, (Mon Sep 29, 8:03 am)
[PATCH] Markers : marker_synchronize_unregister(), Mathieu Desnoyers, (Mon Sep 29, 8:05 am)
[PATCH] RCU read sched, Mathieu Desnoyers, (Mon Sep 29, 8:06 am)
Re: [PATCH] Markers use rcu_read_lock_sched(), Mathieu Desnoyers, (Mon Sep 29, 8:08 am)
[PATCH] Markers : probe example fix teardown, Mathieu Desnoyers, (Mon Sep 29, 8:09 am)
[PATCH] Markers : documentation fix teardown, Mathieu Desnoyers, (Mon Sep 29, 8:10 am)
[PATCH] sputrace : use marker_synchronize_unregister(), Mathieu Desnoyers, (Mon Sep 29, 8:11 am)
Re: [PATCH] sputrace : use marker_synchronize_unregister(), Christoph Hellwig, (Mon Sep 29, 8:13 am)
Re: [PATCH] markers: fix unregister bug and reenter bug, Lai Jiangshan, (Mon Sep 29, 6:40 pm)
Re: [PATCH] Markers : marker_synchronize_unregister(), Lai Jiangshan, (Mon Sep 29, 6:47 pm)
Re: [PATCH] markers: fix unregister bug and reenter bug, Mathieu Desnoyers, (Mon Sep 29, 8:38 pm)
Re: [PATCH] RCU read sched, Ingo Molnar, (Tue Sep 30, 3:08 am)
Re: [PATCH] Markers use rcu_read_lock_sched(), Ingo Molnar, (Tue Sep 30, 3:13 am)
Re: [PATCH] RCU read sched, Paul E. McKenney, (Tue Sep 30, 6:10 am)
Re: [PATCH] RCU read sched, Paul E. McKenney, (Tue Sep 30, 6:10 am)