aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>2008-09-29 11:08:03 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-14 04:38:28 -0400
commite2d3b75dbc486253c910722486ac64087f96c59f (patch)
treec59bf9066f6f4bc290e5330823dbd87429b09e28
parente98d0eabef2748d88fa58760d104e8e68517406b (diff)
markers: fix unregister bug and reenter bug, cleanup
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> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/marker.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/kernel/marker.c b/kernel/marker.c
index 9f76c4a622ec..fe5ca72f9659 100644
--- a/kernel/marker.c
+++ b/kernel/marker.c
@@ -100,11 +100,11 @@ void marker_probe_cb(const struct marker *mdata, void *call_private, ...)
100 char ptype; 100 char ptype;
101 101
102 /* 102 /*
103 * preempt_disable does two things : disabling preemption to make sure 103 * rcu_read_lock_sched does two things : disabling preemption to make
104 * the teardown of the callbacks can be done correctly when they are in 104 * sure the teardown of the callbacks can be done correctly when they
105 * modules and they insure RCU read coherency. 105 * are in modules and they insure RCU read coherency.
106 */ 106 */
107 preempt_disable(); 107 rcu_read_lock_sched();
108 ptype = mdata->ptype; 108 ptype = mdata->ptype;
109 if (likely(!ptype)) { 109 if (likely(!ptype)) {
110 marker_probe_func *func; 110 marker_probe_func *func;
@@ -142,7 +142,7 @@ void marker_probe_cb(const struct marker *mdata, void *call_private, ...)
142 va_end(args); 142 va_end(args);
143 } 143 }
144 } 144 }
145 preempt_enable(); 145 rcu_read_unlock_sched();
146} 146}
147EXPORT_SYMBOL_GPL(marker_probe_cb); 147EXPORT_SYMBOL_GPL(marker_probe_cb);
148 148
@@ -159,7 +159,7 @@ void marker_probe_cb_noarg(const struct marker *mdata, void *call_private, ...)
159 va_list args; /* not initialized */ 159 va_list args; /* not initialized */
160 char ptype; 160 char ptype;
161 161
162 preempt_disable(); 162 rcu_read_lock_sched();
163 ptype = mdata->ptype; 163 ptype = mdata->ptype;
164 if (likely(!ptype)) { 164 if (likely(!ptype)) {
165 marker_probe_func *func; 165 marker_probe_func *func;
@@ -192,7 +192,7 @@ void marker_probe_cb_noarg(const struct marker *mdata, void *call_private, ...)
192 multi[i].func(multi[i].probe_private, call_private, 192 multi[i].func(multi[i].probe_private, call_private,
193 mdata->format, &args); 193 mdata->format, &args);
194 } 194 }
195 preempt_enable(); 195 rcu_read_unlock_sched();
196} 196}
197EXPORT_SYMBOL_GPL(marker_probe_cb_noarg); 197EXPORT_SYMBOL_GPL(marker_probe_cb_noarg);
198 198
@@ -539,7 +539,7 @@ static int set_marker(struct marker_entry **entry, struct marker *elem,
539 * Disable a marker and its probe callback. 539 * Disable a marker and its probe callback.
540 * Note: only waiting an RCU period after setting elem->call to the empty 540 * Note: only waiting an RCU period after setting elem->call to the empty
541 * function insures that the original callback is not used anymore. This insured 541 * function insures that the original callback is not used anymore. This insured
542 * by preempt_disable around the call site. 542 * by rcu_read_lock_sched around the call site.
543 */ 543 */
544static void disable_marker(struct marker *elem) 544static void disable_marker(struct marker *elem)
545{ 545{