Re: [PATCH bpf-next v3] bpf: make the attach target more accurate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2025/7/15 03:52, Alexei Starovoitov wrote:
On Thu, Jul 10, 2025 at 12:10 AM Menglong Dong <menglong8.dong@xxxxxxxxx> 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





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux