summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMenglong Dong <menglong8.dong@gmail.com>2025-09-25 09:56:47 +0900
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>2025-11-01 01:10:28 +0900
commit0de4c70d04a46a3c266547dd4275ce25f623796a (patch)
tree2d2278e9d45039eb2aa1f29da0a849b706b8149d /include
parentdcb6fa37fd7bc9c3d2b066329b0d27dedf8becaa (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/fprobe.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/fprobe.h b/include/linux/fprobe.h
index 7964db96e41a..0a3bcd1718f3 100644
--- a/include/linux/fprobe.h
+++ b/include/linux/fprobe.h
@@ -7,6 +7,7 @@
#include <linux/ftrace.h>
#include <linux/rcupdate.h>
#include <linux/refcount.h>
+#include <linux/rhashtable.h>
#include <linux/slab.h>
struct fprobe;
@@ -26,7 +27,7 @@ typedef void (*fprobe_exit_cb)(struct fprobe *fp, unsigned long entry_ip,
* @fp: The fprobe which owns this.
*/
struct fprobe_hlist_node {
- struct hlist_node hlist;
+ struct rhlist_head hlist;
unsigned long addr;
struct fprobe *fp;
};