(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...@hitachi.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/