aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2024-10-10 16:25:03 -0700
committerAlexei Starovoitov <ast@kernel.org>2024-10-14 18:33:04 -0700
commit4971266e1595f76be3f844c834c1f9357a97dbde (patch)
treed51a010cdaf2492e184bfdc85c68836c50e7a6fa /include/linux
parentlibbpf: Fix possible compiler warnings in hashmap (diff)
downloadwireguard-linux-4971266e1595f76be3f844c834c1f9357a97dbde.tar.xz
wireguard-linux-4971266e1595f76be3f844c834c1f9357a97dbde.zip
bpf: Add kmem_cache iterator
The new "kmem_cache" iterator will traverse the list of slab caches and call attached BPF programs for each entry. It should check the argument (ctx.s) if it's NULL before using it. Now the iteration grabs the slab_mutex only if it traverse the list and releases the mutex when it runs the BPF program. The kmem_cache entry is protected by a refcount during the execution. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Vlastimil Babka <vbabka@suse.cz> #slab Link: https://lore.kernel.org/r/20241010232505.1339892-2-namhyung@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/btf_ids.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h
index c0e3e1426a82..139bdececdcf 100644
--- a/include/linux/btf_ids.h
+++ b/include/linux/btf_ids.h
@@ -283,5 +283,6 @@ extern u32 btf_tracing_ids[];
extern u32 bpf_cgroup_btf_id[];
extern u32 bpf_local_storage_map_btf_id[];
extern u32 btf_bpf_map_id[];
+extern u32 bpf_kmem_cache_btf_id[];
#endif