Re: [PATCH net] bpf: one perf event close won't free bpf program attached by another perf event

2017-09-21 Thread Alexei Starovoitov
On 9/21/17 4:17 AM, Peter Zijlstra wrote: On Wed, Sep 20, 2017 at 10:20:13PM -0700, Yonghong Song wrote: (2). trace_event_call->perf_events are per cpu data structure, that means, some filtering logic is needed to avoid the same perf_event prog is executing twice. What I mean here is that the

Re: [PATCH net] bpf: one perf event close won't free bpf program attached by another perf event

2017-09-21 Thread Steven Rostedt
On Thu, 21 Sep 2017 13:17:06 +0200 Peter Zijlstra wrote: > I suspect that would break a fair bunch of bpf proglets, since the data > access to the trace data would be completely different, but it would be > much nicer to not have this distinction based on event type. Maybe

Re: [PATCH net] bpf: one perf event close won't free bpf program attached by another perf event

2017-09-21 Thread Peter Zijlstra
On Wed, Sep 20, 2017 at 10:20:13PM -0700, Yonghong Song wrote: > > (2). trace_event_call->perf_events are per cpu data structure, that > > means, some filtering logic is needed to avoid the same perf_event prog > > is executing twice. > > What I mean here is that the trace_event_call->perf_events

Re: [PATCH net] bpf: one perf event close won't free bpf program attached by another perf event

2017-09-20 Thread Yonghong Song
On 9/20/17 10:17 PM, Yonghong Song wrote: On 9/20/17 6:41 PM, Steven Rostedt wrote: On Mon, 18 Sep 2017 16:38:36 -0700 Yonghong Song wrote: This patch fixes a bug exhibited by the following scenario:    1. fd1 = perf_event_open with attr.config = ID1    2. attach bpf program

Re: [PATCH net] bpf: one perf event close won't free bpf program attached by another perf event

2017-09-20 Thread Yonghong Song
On 9/20/17 6:41 PM, Steven Rostedt wrote: On Mon, 18 Sep 2017 16:38:36 -0700 Yonghong Song wrote: This patch fixes a bug exhibited by the following scenario: 1. fd1 = perf_event_open with attr.config = ID1 2. attach bpf program prog1 to fd1 3. fd2 = perf_event_open

Re: [PATCH net] bpf: one perf event close won't free bpf program attached by another perf event

2017-09-20 Thread Steven Rostedt
On Mon, 18 Sep 2017 16:38:36 -0700 Yonghong Song wrote: > This patch fixes a bug exhibited by the following scenario: > 1. fd1 = perf_event_open with attr.config = ID1 > 2. attach bpf program prog1 to fd1 > 3. fd2 = perf_event_open with attr.config = ID1 > > 4. user

Re: [PATCH net] bpf: one perf event close won't free bpf program attached by another perf event

2017-09-20 Thread David Miller
From: Yonghong Song Date: Mon, 18 Sep 2017 16:38:36 -0700 > This patch fixes a bug exhibited by the following scenario: > 1. fd1 = perf_event_open with attr.config = ID1 > 2. attach bpf program prog1 to fd1 > 3. fd2 = perf_event_open with attr.config = ID1 > > 4. user

[PATCH net] bpf: one perf event close won't free bpf program attached by another perf event

2017-09-18 Thread Yonghong Song
This patch fixes a bug exhibited by the following scenario: 1. fd1 = perf_event_open with attr.config = ID1 2. attach bpf program prog1 to fd1 3. fd2 = perf_event_open with attr.config = ID1 4. user program closes fd2 and prog1 is detached from the tracepoint. 5. user program with