mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-30 19:15:14 +00:00
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>
This commit is contained in:
parent
d74185ed27
commit
ca2db6cf30
1 changed files with 6 additions and 9 deletions
|
@ -80,10 +80,7 @@ static void tracepoint_entry_free_old(struct tracepoint_entry *entry, void *old)
|
||||||
entry->rcu_pending = 1;
|
entry->rcu_pending = 1;
|
||||||
/* write rcu_pending before calling the RCU callback */
|
/* write rcu_pending before calling the RCU callback */
|
||||||
smp_wmb();
|
smp_wmb();
|
||||||
#ifdef CONFIG_PREEMPT_RCU
|
call_rcu_sched(&entry->rcu, free_old_closure);
|
||||||
synchronize_sched(); /* Until we have the call_rcu_sched() */
|
|
||||||
#endif
|
|
||||||
call_rcu(&entry->rcu, free_old_closure);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void debug_print_probes(struct tracepoint_entry *entry)
|
static void debug_print_probes(struct tracepoint_entry *entry)
|
||||||
|
@ -245,9 +242,9 @@ static int remove_tracepoint(const char *name)
|
||||||
if (e->refcount)
|
if (e->refcount)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
hlist_del(&e->hlist);
|
hlist_del(&e->hlist);
|
||||||
/* Make sure the call_rcu has been executed */
|
/* Make sure the call_rcu_sched has been executed */
|
||||||
if (e->rcu_pending)
|
if (e->rcu_pending)
|
||||||
rcu_barrier();
|
rcu_barrier_sched();
|
||||||
kfree(e);
|
kfree(e);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -344,11 +341,11 @@ int tracepoint_probe_register(const char *name, void *probe)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* If we detect that a call_rcu is pending for this tracepoint,
|
* If we detect that a call_rcu_sched is pending for this tracepoint,
|
||||||
* make sure it's executed now.
|
* make sure it's executed now.
|
||||||
*/
|
*/
|
||||||
if (entry->rcu_pending)
|
if (entry->rcu_pending)
|
||||||
rcu_barrier();
|
rcu_barrier_sched();
|
||||||
old = tracepoint_entry_add_probe(entry, probe);
|
old = tracepoint_entry_add_probe(entry, probe);
|
||||||
if (IS_ERR(old)) {
|
if (IS_ERR(old)) {
|
||||||
ret = PTR_ERR(old);
|
ret = PTR_ERR(old);
|
||||||
|
@ -387,7 +384,7 @@ int tracepoint_probe_unregister(const char *name, void *probe)
|
||||||
if (!entry)
|
if (!entry)
|
||||||
goto end;
|
goto end;
|
||||||
if (entry->rcu_pending)
|
if (entry->rcu_pending)
|
||||||
rcu_barrier();
|
rcu_barrier_sched();
|
||||||
old = tracepoint_entry_remove_probe(entry, probe);
|
old = tracepoint_entry_remove_probe(entry, probe);
|
||||||
mutex_unlock(&tracepoints_mutex);
|
mutex_unlock(&tracepoints_mutex);
|
||||||
tracepoint_update_probes(); /* may update entry */
|
tracepoint_update_probes(); /* may update entry */
|
||||||
|
|
Loading…
Add table
Reference in a new issue