mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
tracepoints: fix reentrancy
The tracepoints had the same problem markers did have wrt reentrancy. Apply a similar fix using a rcu_barrier after each tracepoint mutex lock. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
ca2db6cf30
commit
9a1e9693f5
1 changed files with 4 additions and 0 deletions
|
@ -356,6 +356,8 @@ int tracepoint_probe_register(const char *name, void *probe)
|
||||||
mutex_lock(&tracepoints_mutex);
|
mutex_lock(&tracepoints_mutex);
|
||||||
entry = get_tracepoint(name);
|
entry = get_tracepoint(name);
|
||||||
WARN_ON(!entry);
|
WARN_ON(!entry);
|
||||||
|
if (entry->rcu_pending)
|
||||||
|
rcu_barrier_sched();
|
||||||
tracepoint_entry_free_old(entry, old);
|
tracepoint_entry_free_old(entry, old);
|
||||||
end:
|
end:
|
||||||
mutex_unlock(&tracepoints_mutex);
|
mutex_unlock(&tracepoints_mutex);
|
||||||
|
@ -392,6 +394,8 @@ int tracepoint_probe_unregister(const char *name, void *probe)
|
||||||
entry = get_tracepoint(name);
|
entry = get_tracepoint(name);
|
||||||
if (!entry)
|
if (!entry)
|
||||||
goto end;
|
goto end;
|
||||||
|
if (entry->rcu_pending)
|
||||||
|
rcu_barrier_sched();
|
||||||
tracepoint_entry_free_old(entry, old);
|
tracepoint_entry_free_old(entry, old);
|
||||||
remove_tracepoint(name); /* Ignore busy error message */
|
remove_tracepoint(name); /* Ignore busy error message */
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
Loading…
Reference in a new issue