From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Alexei Starovoitov <ast@fb.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Daniel Borkmann <daniel@iogearbox.net>,
Linus Torvalds <torvalds@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
rostedt <rostedt@goodmis.org>, netdev <netdev@vger.kernel.org>,
kernel-team <kernel-team@fb.com>,
linux-api <linux-api@vger.kernel.org>
Subject: Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time
Date: Wed, 28 Mar 2018 13:14:45 -0400 (EDT) [thread overview]
Message-ID: <754862332.127.1522257285121.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <67c5f9b4-b24a-2806-e8d6-8b5241c66d6e@fb.com>
----- On Mar 28, 2018, at 12:43 PM, Alexei Starovoitov ast@fb.com wrote:
> On 3/28/18 6:49 AM, Mathieu Desnoyers wrote:
>> ----- On Mar 27, 2018, at 10:11 PM, Alexei Starovoitov ast@fb.com wrote:
>>
>>> From: Alexei Starovoitov <ast@kernel.org>
>>>
>>> compute number of arguments passed into tracepoint
>>> at compile time and store it as part of 'struct tracepoint'.
>>> The number is necessary to check safety of bpf program access that
>>> is coming in subsequent patch.
>>
>>
>> Hi Alexei,
>>
>> Given that only eBPF needs this parameter count, we can move
>> it to the struct bpf_raw_event_map newly introduced by Steven,
>> right ? This would reduce bloat of struct tracepoint. For instance,
>> we don't need to keep this count around when eBPF is configured
>> out.
>
> Makes sense. That is indeed cleaner. Will respin.
>
> What I don't like though is 'bloat' argument.
> 'u32 num_args' padded to 8-byte takes exactly the same amount
> of space in 'struct tracepoint' and in 'struct bpf_raw_event_map'
> The number of these structures is the same as well
> and chances that tracepoints are on while bpf is off are slim.
> More so few emails ago you said:
> "I'm perfectly fine with adding the "num_args" stuff. I think it's
> really useful. It's only the for_each_kernel_tracepoint change for
> which I'm trying to understand the rationale."
>
> I'm guessing now you found out that num_args is not useful to lttng
> and it bloats its data structures?
I'm concerned about kernel configurations with only ftrace and
perf, with eBPF disabled. In those configurations, adding ebpf-specific
fields to struct tracepoint increases the kernel image size needlessly.
LTTng is not my concern in this discussion.
I'm also concerned about adding more and more elements to struct tracepoint
in general. For instance, I'd really like to see the regfunc/unregfunc
fields go away into a different section, allowing us to reduce the size of
struct tracepoint, so we can do a better use of the CPU caches when
tracing is enabled. The "funcs" field needs to be loaded each time a
tracepoint is fired, and therefore needs to be cache-hot. Adding more
cache-cold fields in there degrades cache locality, because "hot"
cache-lines then need to hold more cache-cold data.
> It's ok to change an opinion and I'm completely fine using that as
> a real reason.
Seeing the code of the new eBPF section provided by Steven made me realize
that we could use it to hold the num_args as well, keeping all the eBPF
data nice and tidy together. So yes, this is new information that changed
my opinion on the matter.
> Will repsin, as I said. No problem.
Thanks!
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
next prev parent reply other threads:[~2018-03-28 17:14 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-28 2:10 [PATCH v7 bpf-next 00/10] bpf, tracing: introduce bpf raw tracepoints Alexei Starovoitov
2018-03-28 2:10 ` [PATCH v7 bpf-next 01/10] treewide: remove large struct-pass-by-value from tracepoint arguments Alexei Starovoitov
2018-03-28 2:10 ` [PATCH v7 bpf-next 02/10] net/mediatek: disambiguate mt76 vs mt7601u trace events Alexei Starovoitov
2018-03-28 2:10 ` [PATCH v7 bpf-next 03/10] net/mac802154: disambiguate mac80215 vs mac802154 " Alexei Starovoitov
2018-03-28 2:10 ` [PATCH v7 bpf-next 04/10] net/wireless/iwlwifi: fix iwlwifi_dev_ucode_error tracepoint Alexei Starovoitov
2018-03-28 2:11 ` [PATCH v7 bpf-next 05/10] macro: introduce COUNT_ARGS() macro Alexei Starovoitov
2018-03-28 2:11 ` [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time Alexei Starovoitov
2018-03-28 13:49 ` Mathieu Desnoyers
2018-03-28 16:43 ` Alexei Starovoitov
2018-03-28 17:04 ` Steven Rostedt
2018-03-28 17:10 ` Alexei Starovoitov
2018-03-28 17:38 ` Steven Rostedt
2018-03-28 18:03 ` Alexei Starovoitov
2018-03-28 18:10 ` Steven Rostedt
2018-03-28 18:19 ` Alexei Starovoitov
2018-03-28 18:54 ` Steven Rostedt
2018-03-28 19:22 ` Mathieu Desnoyers
2018-03-28 19:25 ` Alexei Starovoitov
2018-03-28 19:32 ` Steven Rostedt
2018-03-28 19:38 ` Steven Rostedt
2018-03-28 19:47 ` Mathieu Desnoyers
2018-03-28 17:14 ` Mathieu Desnoyers [this message]
2018-03-28 2:11 ` [PATCH v7 bpf-next 07/10] bpf: introduce BPF_RAW_TRACEPOINT Alexei Starovoitov
2018-03-28 17:41 ` Steven Rostedt
2018-03-28 2:11 ` [PATCH v7 bpf-next 08/10] libbpf: add bpf_raw_tracepoint_open helper Alexei Starovoitov
2018-03-28 2:11 ` [PATCH v7 bpf-next 09/10] samples/bpf: raw tracepoint test Alexei Starovoitov
2018-03-28 2:11 ` [PATCH v7 bpf-next 10/10] selftests/bpf: test for bpf_get_stackid() from raw tracepoints 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=754862332.127.1522257285121.JavaMail.zimbra@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=ast@fb.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=kernel-team@fb.com \
--cc=linux-api@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.org \
/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;
as well as URLs for NNTP newsgroup(s).