Re: [PATCH v8 03/10] tracing: Add 'traceon' and 'traceoff' eventtrigger commands
From: Masami Hiramatsu
Date: Fri Sep 06 2013 - 08:38:11 EST
(2013/09/06 5:46), Steven Rostedt wrote:
> On Mon, 2 Sep 2013 22:52:19 -0500
> Tom Zanussi <tom.zanussi@xxxxxxxxxxxxxxx> wrote:
>> extern void destroy_preds(struct ftrace_event_call *call);
>> diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
>> index 85319cf..5388d55 100644
>> --- a/kernel/trace/trace_events_trigger.c
>> +++ b/kernel/trace/trace_events_trigger.c
>> @@ -28,6 +28,13 @@
>> static LIST_HEAD(trigger_commands);
>> static DEFINE_MUTEX(trigger_cmd_mutex);
>>
>> +static void
>> +trigger_data_free(struct event_trigger_data *data)
>> +{
>> + synchronize_sched(); /* make sure current triggers exit before free */
>
> Again, I think this can and should be synchronize_rcu().
>
As in the previous patch, event triggers called under preempt disabled.
> +void event_triggers_call(struct ftrace_event_file *file)
> +{
> + struct event_trigger_data *data;
> +
> + if (list_empty(&file->triggers))
> + return;
> +
> + preempt_disable_notrace();
> + list_for_each_entry_rcu(data, &file->triggers, list)
> + data->ops->func(data);
> + preempt_enable_notrace();
> +}
In this case, I think synchronize_sched() is correct. Of course,
we need to discuss why it needs to disable preempt here. :)
Thank you,
--
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@xxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/