tracing: Fix synchronizing to event changes with tracepoint_synchronize_unregister()

Now that some trace events can be protected by srcu_read_lock(tracepoint_srcu),
we need to make sure all locations that depend on this are also protected.
There were many places that did a synchronize_sched() thinking that it was
enough to protect againts access to trace events. This use to be the case,
but now that we use SRCU for _rcuidle() trace events, they may not be
protected by synchronize_sched(), as they may be called in paths that RCU is
not watching for preempt disable.

Fixes: e6753f23d9 ("tracepoint: Make rcuidle tracepoint callers use SRCU")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
Steven Rostedt (VMware)
2018-08-09 15:31:48 -04:00
parent b207de3ec5
commit e0a568dcd1
4 changed files with 17 additions and 14 deletions
+4 -2
View File
@@ -34,7 +34,9 @@ void trigger_data_free(struct event_trigger_data *data)
if (data->cmd_ops->set_filter)
data->cmd_ops->set_filter(NULL, data, NULL);
synchronize_sched(); /* make sure current triggers exit before free */
/* make sure current triggers exit before free */
tracepoint_synchronize_unregister();
kfree(data);
}
@@ -752,7 +754,7 @@ int set_trigger_filter(char *filter_str,
if (tmp) {
/* Make sure the call is done with the filter */
synchronize_sched();
tracepoint_synchronize_unregister();
free_event_filter(tmp);
}