From: Yonghong Song <yhs@fb.com>
To: Andrii Nakryiko <andriin@fb.com>, <bpf@vger.kernel.org>,
<netdev@vger.kernel.org>, <ast@fb.com>, <daniel@iogearbox.net>
Cc: <andrii.nakryiko@gmail.com>, <kernel-team@fb.com>,
John Fastabend <john.fastabend@gmail.com>
Subject: Re: [PATCH v2 bpf-next 2/3] selftest/bpf: fmod_ret prog and implement test_overhead as part of bench
Date: Sat, 9 May 2020 10:23:53 -0700 [thread overview]
Message-ID: <c2fbefd2-6137-712e-47d4-200ef4d74775@fb.com> (raw)
In-Reply-To: <20200508232032.1974027-3-andriin@fb.com>
On 5/8/20 4:20 PM, Andrii Nakryiko wrote:
> Add fmod_ret BPF program to existing test_overhead selftest. Also re-implement
> user-space benchmarking part into benchmark runner to compare results. Results
> with ./bench are consistently somewhat lower than test_overhead's, but relative
> performance of various types of BPF programs stay consisten (e.g., kretprobe is
> noticeably slower).
>
> run_bench_rename.sh script (in benchs/ directory) was used to produce the
> following numbers:
>
> base : 3.975 ± 0.065M/s
> kprobe : 3.268 ± 0.095M/s
> kretprobe : 2.496 ± 0.040M/s
> rawtp : 3.899 ± 0.078M/s
> fentry : 3.836 ± 0.049M/s
> fexit : 3.660 ± 0.082M/s
> fmodret : 3.776 ± 0.033M/s
>
> While running test_overhead gives:
>
> task_rename base 4457K events per sec
> task_rename kprobe 3849K events per sec
> task_rename kretprobe 2729K events per sec
> task_rename raw_tp 4506K events per sec
> task_rename fentry 4381K events per sec
> task_rename fexit 4349K events per sec
> task_rename fmod_ret 4130K events per sec
Do you where the overhead is and how we could provide options in
bench to reduce the overhead so we can achieve similar numbers?
For benchmarking, sometimes you really want to see "true"
potential of a particular implementation.
>
> Acked-by: John Fastabend <john.fastabend@gmail.com>
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> ---
> tools/testing/selftests/bpf/Makefile | 4 +-
> tools/testing/selftests/bpf/bench.c | 14 ++
> .../selftests/bpf/benchs/bench_rename.c | 195 ++++++++++++++++++
> .../selftests/bpf/benchs/run_bench_rename.sh | 9 +
> .../selftests/bpf/prog_tests/test_overhead.c | 14 +-
> .../selftests/bpf/progs/test_overhead.c | 6 +
> 6 files changed, 240 insertions(+), 2 deletions(-)
> create mode 100644 tools/testing/selftests/bpf/benchs/bench_rename.c
> create mode 100755 tools/testing/selftests/bpf/benchs/run_bench_rename.sh
>
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index 289fffbf975e..29a02abf81a3 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -409,10 +409,12 @@ $(OUTPUT)/test_cpp: test_cpp.cpp $(OUTPUT)/test_core_extern.skel.h $(BPFOBJ)
> $(OUTPUT)/bench_%.o: benchs/bench_%.c bench.h
> $(call msg,CC,,$@)
> $(CC) $(CFLAGS) -c $(filter %.c,$^) $(LDLIBS) -o $@
> +$(OUTPUT)/bench_rename.o: $(OUTPUT)/test_overhead.skel.h
> $(OUTPUT)/bench.o: bench.h
> $(OUTPUT)/bench: LDLIBS += -lm
> $(OUTPUT)/bench: $(OUTPUT)/bench.o \
> - $(OUTPUT)/bench_count.o
> + $(OUTPUT)/bench_count.o \
> + $(OUTPUT)/bench_rename.o
> $(call msg,BINARY,,$@)
> $(CC) $(LDFLAGS) -o $@ $(filter %.a %.o,$^) $(LDLIBS)
>
[...]
next prev parent reply other threads:[~2020-05-09 17:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-08 23:20 [PATCH v2 bpf-next 0/3] Add benchmark runner and few benchmarks Andrii Nakryiko
2020-05-08 23:20 ` [PATCH v2 bpf-next 1/3] selftests/bpf: add benchmark runner infrastructure Andrii Nakryiko
2020-05-09 17:10 ` Yonghong Song
2020-05-12 3:29 ` Andrii Nakryiko
2020-05-12 14:39 ` Yonghong Song
2020-05-08 23:20 ` [PATCH v2 bpf-next 2/3] selftest/bpf: fmod_ret prog and implement test_overhead as part of bench Andrii Nakryiko
2020-05-09 17:23 ` Yonghong Song [this message]
2020-05-12 4:22 ` Andrii Nakryiko
2020-05-12 15:11 ` Yonghong Song
2020-05-12 17:23 ` Andrii Nakryiko
2020-05-12 17:47 ` Yonghong Song
2020-05-08 23:20 ` [PATCH v2 bpf-next 3/3] selftest/bpf: add BPF triggering benchmark Andrii Nakryiko
2020-05-09 17:43 ` Yonghong Song
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=c2fbefd2-6137-712e-47d4-200ef4d74775@fb.com \
--to=yhs@fb.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andriin@fb.com \
--cc=ast@fb.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=john.fastabend@gmail.com \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.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