]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> |
2 | Subject: Markers use rcu_read_lock_sched() | |
3 | ||
4 | Use the new rcu_read_lock_sched/unlock_sched() in marker code around the call | |
5 | site instead of preempt_disable/enable(). It helps reviewing the code more | |
6 | easily. | |
7 | ||
8 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | |
9 | CC: Peter Zijlstra <peterz@infradead.org> | |
10 | CC: Paul E McKenney <paulmck@linux.vnet.ibm.com> | |
11 | CC: akpm@linux-foundation.org | |
12 | Acked-by: Jan Blunck <jblunck@suse.de> | |
13 | --- | |
14 | kernel/marker.c | 16 ++++++++-------- | |
15 | 1 file changed, 8 insertions(+), 8 deletions(-) | |
16 | ||
17 | Index: b/kernel/marker.c | |
18 | =================================================================== | |
19 | --- a/kernel/marker.c | |
20 | +++ b/kernel/marker.c | |
21 | @@ -103,11 +103,11 @@ void marker_probe_cb(const struct marker | |
22 | char ptype; | |
23 | ||
24 | /* | |
25 | - * preempt_disable does two things : disabling preemption to make sure | |
26 | - * the teardown of the callbacks can be done correctly when they are in | |
27 | - * modules and they insure RCU read coherency. | |
28 | + * rcu_read_lock_sched does two things : disabling preemption to make | |
29 | + * sure the teardown of the callbacks can be done correctly when they | |
30 | + * are in modules and they insure RCU read coherency. | |
31 | */ | |
32 | - preempt_disable(); | |
33 | + rcu_read_lock_sched(); | |
34 | ptype = mdata->ptype; | |
35 | if (likely(!ptype)) { | |
36 | marker_probe_func *func; | |
37 | @@ -145,7 +145,7 @@ void marker_probe_cb(const struct marker | |
38 | va_end(args); | |
39 | } | |
40 | } | |
41 | - preempt_enable(); | |
42 | + rcu_read_unlock_sched(); | |
43 | } | |
44 | EXPORT_SYMBOL_GPL(marker_probe_cb); | |
45 | ||
46 | @@ -162,7 +162,7 @@ void marker_probe_cb_noarg(const struct | |
47 | va_list args; /* not initialized */ | |
48 | char ptype; | |
49 | ||
50 | - preempt_disable(); | |
51 | + rcu_read_lock_sched(); | |
52 | ptype = mdata->ptype; | |
53 | if (likely(!ptype)) { | |
54 | marker_probe_func *func; | |
55 | @@ -195,7 +195,7 @@ void marker_probe_cb_noarg(const struct | |
56 | multi[i].func(multi[i].probe_private, call_private, | |
57 | mdata->format, &args); | |
58 | } | |
59 | - preempt_enable(); | |
60 | + rcu_read_unlock_sched(); | |
61 | } | |
62 | EXPORT_SYMBOL_GPL(marker_probe_cb_noarg); | |
63 | ||
64 | @@ -560,7 +560,7 @@ static int set_marker(struct marker_entr | |
65 | * Disable a marker and its probe callback. | |
66 | * Note: only waiting an RCU period after setting elem->call to the empty | |
67 | * function insures that the original callback is not used anymore. This insured | |
68 | - * by preempt_disable around the call site. | |
69 | + * by rcu_read_lock_sched around the call site. | |
70 | */ | |
71 | static void disable_marker(struct marker *elem) | |
72 | { |