Re: __trace_remove_event_dirs() leaks file->filter ? (Was: probe_event_disable()->synchronize_sched())

2014-07-04 Thread Oleg Nesterov
On 07/04, Masami Hiramatsu wrote: > > (2014/07/04 2:01), Oleg Nesterov wrote: > > On 07/03, Oleg Nesterov wrote: > >> > >> Hmm. Off-topic, but it seems that instance_rmdir() leaks the memory? Say, > >> file->filter? > > > > Perhaps I am totally confused, but don't we need something like the patch >

Re: probe_event_disable()->synchronize_sched()

2014-07-04 Thread Namhyung Kim
Hi Masami, On Fri, 04 Jul 2014 10:00:51 +0900, Masami Hiramatsu wrote: > (2014/07/03 16:44), Namhyung Kim wrote: >> Hi Masami, >> >> On Thu, 03 Jul 2014 14:46:09 +0900, Masami Hiramatsu wrote: >>> One possible scenario is here; someone disables an event and tries to remove >>> it (both will be do

Re: __trace_remove_event_dirs() leaks file->filter ? (Was: probe_event_disable()->synchronize_sched())

2014-07-03 Thread Masami Hiramatsu
(2014/07/04 2:01), Oleg Nesterov wrote: > On 07/03, Oleg Nesterov wrote: >> >> Hmm. Off-topic, but it seems that instance_rmdir() leaks the memory? Say, >> file->filter? > > Perhaps I am totally confused, but don't we need something like the patch > below? I'll try to recheck later... > > Better

Re: probe_event_disable()->synchronize_sched() (Was: tracing/uprobes: Revert "Support mix of ftrace and perf")

2014-07-03 Thread Masami Hiramatsu
(2014/07/04 1:22), Oleg Nesterov wrote: >> One possible scenario is here; someone disables an event and tries to remove >> it (both will be done by different syscalls). If we don't synchronize >> the first disabling, the event flag set disabled, but the event itself >> is not disabled. Thus event

Re: probe_event_disable()->synchronize_sched()

2014-07-03 Thread Masami Hiramatsu
(2014/07/03 16:44), Namhyung Kim wrote: > Hi Masami, > > On Thu, 03 Jul 2014 14:46:09 +0900, Masami Hiramatsu wrote: >> One possible scenario is here; someone disables an event and tries to remove >> it (both will be done by different syscalls). If we don't synchronize >> the first disabling, the

__trace_remove_event_dirs() leaks file->filter ? (Was: probe_event_disable()->synchronize_sched())

2014-07-03 Thread Oleg Nesterov
On 07/03, Oleg Nesterov wrote: > > Hmm. Off-topic, but it seems that instance_rmdir() leaks the memory? Say, > file->filter? Perhaps I am totally confused, but don't we need something like the patch below? I'll try to recheck later... Better yet, we can probably move destroy_preds() from event_re

Re: probe_event_disable()->synchronize_sched() (Was: tracing/uprobes: Revert "Support mix of ftrace and perf")

2014-07-03 Thread Oleg Nesterov
On 07/03, Masami Hiramatsu wrote: > > (2014/07/02 4:31), Oleg Nesterov wrote: > > And. I am puzzled by probe_event_disable()->synchronize_sched(). Why > > do we need it? I mean, why we can't use call_rcu() ? The comment says > > "synchronize with u{,ret}pro

Re: probe_event_disable()->synchronize_sched()

2014-07-03 Thread Oleg Nesterov
On 07/03, Namhyung Kim wrote: > > On Tue, 1 Jul 2014 21:31:47 +0200, Oleg Nesterov wrote: > > > > And. I am puzzled by probe_event_disable()->synchronize_sched(). Why > > do we need it? I mean, why we can't use call_rcu() ? The comment says > > "synch

Re: probe_event_disable()->synchronize_sched()

2014-07-03 Thread Namhyung Kim
Hi Masami, On Thu, 03 Jul 2014 14:46:09 +0900, Masami Hiramatsu wrote: > One possible scenario is here; someone disables an event and tries to remove > it (both will be done by different syscalls). If we don't synchronize > the first disabling, the event flag set disabled, but the event itself > i

Re: probe_event_disable()->synchronize_sched() (Was: tracing/uprobes: Revert "Support mix of ftrace and perf")

2014-07-02 Thread Masami Hiramatsu
; clear it if _register() fails. And uprobe_dispatcher() is very ugly if > is_ret_probe(). And more. So it needs a series. > > ----- > And. I am puzzled by probe_event_disable()->synchronize_sched(). Why > do we need it? I mean, why we can't use call_rcu() ? The comment says > "syn

Re: probe_event_disable()->synchronize_sched() (Was: tracing/uprobes: Revert "Support mix of ftrace and perf")

2014-07-02 Thread Masami Hiramatsu
; clear it if _register() fails. And uprobe_dispatcher() is very ugly if > is_ret_probe(). And more. So it needs a series. > > ----- > And. I am puzzled by probe_event_disable()->synchronize_sched(). Why > do we need it? I mean, why we can't use call_rcu() ? The comment says > "syn

Re: probe_event_disable()->synchronize_sched()

2014-07-02 Thread Namhyung Kim
and then > clear it if _register() fails. And uprobe_dispatcher() is very ugly if > is_ret_probe(). And more. So it needs a series. Okay, I'd like to see it. :) > > - > And. I am puzzled by pro

probe_event_disable()->synchronize_sched() (Was: tracing/uprobes: Revert "Support mix of ftrace and perf")

2014-07-01 Thread Oleg Nesterov
on to carefully set (say) TP_FLAG_TRACE before uprobe_register() and then clear it if _register() fails. And uprobe_dispatcher() is very ugly if is_ret_probe(). And more. So it needs a series. ----- And. I am puzzled by probe_event_disable()-&