mm/bpf: Add bpf_get_slab_cache() kfunc
The bpf_get_slab_cache() is to get a slab cache information from a
virtual address like virt_to_cache(). If the address is a pointer
to a slab object, it'd return a valid kmem_cache pointer, otherwise
NULL is returned.
It doesn't grab a reference count of the kmem_cache so the caller is
responsible to manage the access. The intended use case for now is to
symbolize locks in slab objects from the lock contention tracepoints.
Suggested-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
2 files changed