tracing: Fix free of probe entry by calling call_rcu_sched()

commit 740466bc89 upstream.

Because function tracing is very invasive, and can even trace
calls to rcu_read_lock(), RCU access in function tracing is done
with preempt_disable_notrace(). This requires a synchronize_sched()
for updates and not a synchronize_rcu().

Function probes (traceon, traceoff, etc) must be freed after
a synchronize_sched() after its entry has been removed from the
hash. But call_rcu() is used. Fix this by using call_rcu_sched().

Also fix the usage to use hlist_del_rcu() instead of hlist_del().

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Steven Rostedt (Red Hat)
2013-03-13 11:15:19 -04:00
committed by Greg Kroah-Hartman
parent 75e4777264
commit f3654cba3e

View File

@@ -3082,8 +3082,8 @@ __unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
continue; continue;
} }
hlist_del(&entry->node); hlist_del_rcu(&entry->node);
call_rcu(&entry->rcu, ftrace_free_entry_rcu); call_rcu_sched(&entry->rcu, ftrace_free_entry_rcu);
} }
} }
__disable_ftrace_function_probe(); __disable_ftrace_function_probe();