diff options
author | Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | 2008-09-30 01:49:39 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-14 04:38:21 -0400 |
commit | ca2db6cf30d6a45798b7a760d0c4f7735b16799d (patch) | |
tree | 5c1658ec172fdaa04ee018972eb96f0f2c409676 /kernel/tracepoint.c | |
parent | d74185ed27651ad8d920b37d7851306ad01f7d6f (diff) |
tracepoints: use rcu sched
Make tracepoints use rcu sched. (cleanup)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/tracepoint.c')
-rw-r--r-- | kernel/tracepoint.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c index c7c62a4a75f5..db39961a0d03 100644 --- a/kernel/tracepoint.c +++ b/kernel/tracepoint.c | |||
@@ -80,10 +80,7 @@ static void tracepoint_entry_free_old(struct tracepoint_entry *entry, void *old) | |||
80 | entry->rcu_pending = 1; | 80 | entry->rcu_pending = 1; |
81 | /* write rcu_pending before calling the RCU callback */ | 81 | /* write rcu_pending before calling the RCU callback */ |
82 | smp_wmb(); | 82 | smp_wmb(); |
83 | #ifdef CONFIG_PREEMPT_RCU | 83 | call_rcu_sched(&entry->rcu, free_old_closure); |
84 | synchronize_sched(); /* Until we have the call_rcu_sched() */ | ||
85 | #endif | ||
86 | call_rcu(&entry->rcu, free_old_closure); | ||
87 | } | 84 | } |
88 | 85 | ||
89 | static void debug_print_probes(struct tracepoint_entry *entry) | 86 | static void debug_print_probes(struct tracepoint_entry *entry) |
@@ -245,9 +242,9 @@ static int remove_tracepoint(const char *name) | |||
245 | if (e->refcount) | 242 | if (e->refcount) |
246 | return -EBUSY; | 243 | return -EBUSY; |
247 | hlist_del(&e->hlist); | 244 | hlist_del(&e->hlist); |
248 | /* Make sure the call_rcu has been executed */ | 245 | /* Make sure the call_rcu_sched has been executed */ |
249 | if (e->rcu_pending) | 246 | if (e->rcu_pending) |
250 | rcu_barrier(); | 247 | rcu_barrier_sched(); |
251 | kfree(e); | 248 | kfree(e); |
252 | return 0; | 249 | return 0; |
253 | } | 250 | } |
@@ -344,11 +341,11 @@ int tracepoint_probe_register(const char *name, void *probe) | |||
344 | } | 341 | } |
345 | } | 342 | } |
346 | /* | 343 | /* |
347 | * If we detect that a call_rcu is pending for this tracepoint, | 344 | * If we detect that a call_rcu_sched is pending for this tracepoint, |
348 | * make sure it's executed now. | 345 | * make sure it's executed now. |
349 | */ | 346 | */ |
350 | if (entry->rcu_pending) | 347 | if (entry->rcu_pending) |
351 | rcu_barrier(); | 348 | rcu_barrier_sched(); |
352 | old = tracepoint_entry_add_probe(entry, probe); | 349 | old = tracepoint_entry_add_probe(entry, probe); |
353 | if (IS_ERR(old)) { | 350 | if (IS_ERR(old)) { |
354 | ret = PTR_ERR(old); | 351 | ret = PTR_ERR(old); |
@@ -387,7 +384,7 @@ int tracepoint_probe_unregister(const char *name, void *probe) | |||
387 | if (!entry) | 384 | if (!entry) |
388 | goto end; | 385 | goto end; |
389 | if (entry->rcu_pending) | 386 | if (entry->rcu_pending) |
390 | rcu_barrier(); | 387 | rcu_barrier_sched(); |
391 | old = tracepoint_entry_remove_probe(entry, probe); | 388 | old = tracepoint_entry_remove_probe(entry, probe); |
392 | mutex_unlock(&tracepoints_mutex); | 389 | mutex_unlock(&tracepoints_mutex); |
393 | tracepoint_update_probes(); /* may update entry */ | 390 | tracepoint_update_probes(); /* may update entry */ |