Re: [PATCH v8 01/10] tracing: Add support for SOFT_DISABLE to syscallevents

From: Masami Hiramatsu
Date: Fri Sep 06 2013 - 08:22:23 EST


(2013/09/06 1:01), Steven Rostedt wrote:
> On Mon, 2 Sep 2013 22:52:17 -0500
>
>> @@ -415,10 +429,15 @@ static void unreg_event_syscall_enter(struct ftrace_event_file *file,
>> return;
>> mutex_lock(&syscall_trace_lock);
>> tr->sys_refcount_enter--;
>> - clear_bit(num, tr->enabled_enter_syscalls);
>> + rcu_assign_pointer(tr->enter_syscall_files[num], NULL);
>> if (!tr->sys_refcount_enter)
>> unregister_trace_sys_enter(ftrace_syscall_enter, tr);
>> mutex_unlock(&syscall_trace_lock);
>> + /*
>> + * Callers expect the event to be completely disabled on
>> + * return, so wait for current handlers to finish.
>> + */
>> + synchronize_sched();
>
> We only have to wait for rcu, not preemption correct? Then we need to
> do synchronize_rcu() instead.

Hmm, the reason why trace_kprobe.c uses synchronize_sched() in unreg
function, is to avoid touching freeing event_file in running kprobe
handlers which run under preemption disabled.

And AFAICS, the tracepoint (on which the syscall tracer based)
call-site uses rcu_read_lock_sched_notrace() instead of rcu_read_lock(),
in that case, I think we should use synchronize_sched(). is that wrong?

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/