summaryrefslogtreecommitdiff
path: root/include/linux/string.h
diff options
context:
space:
mode:
authorRoman Gushchin <roman.gushchin@linux.dev>2025-12-22 20:41:52 -0800
committerAlexei Starovoitov <ast@kernel.org>2025-12-22 22:20:21 -0800
commit5904db9891f80f84283648121e2d8c8a506296a8 (patch)
treeb7389ef8a704b6fe02bcad742a74001bf5a9b3f9 /include/linux/string.h
parent4221de8c410e7adb1114a4374c78fa4269175343 (diff)
mm: introduce BPF kfuncs to deal with memcg pointers
To effectively operate with memory cgroups in BPF there is a need to convert css pointers to memcg pointers. A simple container_of cast which is used in the kernel code can't be used in BPF because from the verifier's point of view that's a out-of-bounds memory access. Introduce helper get/put kfuncs which can be used to get a refcounted memcg pointer from the css pointer: - bpf_get_mem_cgroup, - bpf_put_mem_cgroup. bpf_get_mem_cgroup() can take both memcg's css and the corresponding cgroup's "self" css. It allows it to be used with the existing cgroup iterator which iterates over cgroup tree, not memcg tree. Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev> Link: https://lore.kernel.org/r/20251223044156.208250-3-roman.gushchin@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux/string.h')
0 files changed, 0 insertions, 0 deletions