]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tracing: fprobe: use rhltable for fprobe_ip_table
authorMenglong Dong <menglong8.dong@gmail.com>
Thu, 25 Sep 2025 00:56:47 +0000 (09:56 +0900)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Fri, 31 Oct 2025 16:10:28 +0000 (01:10 +0900)
commit0de4c70d04a46a3c266547dd4275ce25f623796a
tree2d2278e9d45039eb2aa1f29da0a849b706b8149d
parentdcb6fa37fd7bc9c3d2b066329b0d27dedf8becaa
tracing: fprobe: use rhltable for fprobe_ip_table

For now, all the kernel functions who are hooked by the fprobe will be
added to the hash table "fprobe_ip_table". The key of it is the function
address, and the value of it is "struct fprobe_hlist_node".

The budget of the hash table is FPROBE_IP_TABLE_SIZE, which is 256. And
this means the overhead of the hash table lookup will grow linearly if
the count of the functions in the fprobe more than 256. When we try to
hook all the kernel functions, the overhead will be huge.

Therefore, replace the hash table with rhltable to reduce the overhead.

Link: https://lore.kernel.org/all/20250819031825.55653-1-dongml2@chinatelecom.cn/
Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
include/linux/fprobe.h
kernel/trace/fprobe.c