[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <750dd5f1-a5f8-4ed2-a448-1a57cb5447dc@linux.dev>
Date: Tue, 15 Jul 2025 05:50:10 +0800
From: Menglong Dong <menglong.dong@...ux.dev>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>,
Menglong Dong <menglong8.dong@...il.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
John Fastabend <john.fastabend@...il.com>,
Andrii Nakryiko <andrii@...nel.org>, Martin KaFai Lau
<martin.lau@...ux.dev>, Eduard <eddyz87@...il.com>,
Song Liu <song@...nel.org>, Yonghong Song <yonghong.song@...ux.dev>,
KP Singh <kpsingh@...nel.org>, Stanislav Fomichev <sdf@...ichev.me>,
Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
bpf <bpf@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>,
Menglong Dong <dongml2@...natelecom.cn>
Subject: Re: [PATCH bpf-next v3] bpf: make the attach target more accurate
On 2025/7/15 03:52, Alexei Starovoitov wrote:
> On Thu, Jul 10, 2025 at 12:10 AM Menglong Dong <menglong8.dong@...il.com> wrote:
>> } else {
>> - addr = kallsyms_lookup_name(tname);
>> + ret = bpf_lookup_attach_addr(NULL, tname, &addr);
>> }
> Not sure why your benchmarking doesn't show the difference,
> but above is a big regression.
> kallsyms_lookup_name() is a binary search whereas your
> bpf_lookup_attach_addr() is linear.
> You should see a massive degradation in multi-kprobe attach speeds.
Hi, Alexei. Like I said above, the benchmarking does have
a difference for the symbol in the modules, which makes
the attachment time increased from 0.135543s to 0.176904s
for 8631 symbols. As the symbols in the modules
is not plentiful, which makes the overhead slight(or not?).
But for the symbol in vmlinux, bpf_lookup_attach_addr() will
call kallsyms_on_each_match_symbol(), which is also
a binary search, so the benchmarking has no difference,
which makes sense.
I thought we don't need this patch after the pahole fixes this
problem. Should I send a V4?
Thanks!
Menglong Dong
>
> --
> pw-bot: cr
>
Powered by blists - more mailing lists