From: Peter Zijlstra <peterz@infradead.org>
To: Yonghong Song <yhs@fb.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
ast@fb.com, daniel@iogearbox.net, netdev@vger.kernel.org,
kernel-team@fb.com
Subject: Re: [PATCH net] bpf: one perf event close won't free bpf program attached by another perf event
Date: Thu, 21 Sep 2017 13:17:06 +0200 [thread overview]
Message-ID: <20170921111706.343om7252gcagco6@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <9e968490-87ae-7a79-9e59-0dcc840a93f5@fb.com>
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 need to be
> checked on ALL cpus since bpf prog should be executed regardless of
> cpu affiliation. It is possible that the same perf_event in different
> per_cpu bucket and hence filtering is needed to avoid the same
> perf_event bpf_prog is executed twice.
An event will only ever be on a single CPU's list at any one time IIRC.
Now, hysterically perf_event_set_bpf_prog used the tracepoint crud
because that already had bpf bits in. But it might make sense to look at
unifying the bpf stuff across all the different event types. Have them
all use event->prog.
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.
next prev parent reply other threads:[~2017-09-21 11:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 23:38 [PATCH net] bpf: one perf event close won't free bpf program attached by another perf event Yonghong Song
2017-09-20 21:12 ` David Miller
2017-09-21 1:41 ` Steven Rostedt
2017-09-21 5:17 ` Yonghong Song
2017-09-21 5:20 ` Yonghong Song
2017-09-21 11:17 ` Peter Zijlstra [this message]
2017-09-21 14:02 ` Steven Rostedt
2017-09-21 21:53 ` Alexei Starovoitov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170921111706.343om7252gcagco6@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=ast@fb.com \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox