tracepoints: fix reentrancy
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Tue, 30 Sep 2008 05:51:12 +0000 (01:51 -0400)
committerIngo Molnar <mingo@elte.hu>
Tue, 14 Oct 2008 08:38:23 +0000 (10:38 +0200)
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>
kernel/tracepoint.c

index db39961a0d0377cf6e1d52edf14bb2949d2e79a2..f2b7c28a4708f525bd03a86fc053b614869f9599 100644 (file)
@@ -356,6 +356,8 @@ int tracepoint_probe_register(const char *name, void *probe)
        mutex_lock(&tracepoints_mutex);
        entry = get_tracepoint(name);
        WARN_ON(!entry);
+       if (entry->rcu_pending)
+               rcu_barrier_sched();
        tracepoint_entry_free_old(entry, old);
 end:
        mutex_unlock(&tracepoints_mutex);
@@ -392,6 +394,8 @@ int tracepoint_probe_unregister(const char *name, void *probe)
        entry = get_tracepoint(name);
        if (!entry)
                goto end;
+       if (entry->rcu_pending)
+               rcu_barrier_sched();
        tracepoint_entry_free_old(entry, old);
        remove_tracepoint(name);        /* Ignore busy error message */
        ret = 0;