__cgroup_bpf_replace(9)
π __cgroup_bpf_replace(9) π
okay so welcome to the Kernel API Manual entry for __cgroup_bpf_replace(9), bestie. this one is lowkey niche but highkey important if you're messing with cgroup BPF internals, so grab your iced coffee and let's get into it π
β¨ NAME β¨
__cgroup_bpf_replace β replace link's program and propagate the change to descendants. fr fr, that's the whole vibe of this function π
π οΈ SYNOPSIS π οΈ
int __cgroup_bpf_replace (struct cgroup *cgrp , struct bpf_cgroup_link *link , struct bpf_prog *new_prog );
π§ ARGUMENTS π§
cgrpβ the cgroup whose descendants you're traversing, iykyk πΈlinkβ a link for which to replace the BPF program πnew_progβ astruct bpf_progfor the target BPF program, with its refcnt incremented β¨
π DESCRIPTION π
okay so the way that this is literally a βread the fine printβ moment: Must be called with cgroup_mutex held. no cap. do not skip that part, bestie π
π¨ bestie warning: Must be called with cgroup_mutex held. like, that is the vibe check. periodt.
π SEE ALSO π
if you're going down the kernel rabbit hole β and honestly, obsessed β peek at the kernel file ./kernel/bpf/cgroup.c and these icons:
- Kernel file:
./kernel/bpf/cgroup.c cgroup_bpf_release(9)cgroup_bpf_release_fn(9)cgroup_bpf_inherit(9)__cgroup_bpf_attach(9)purge_effective_progs(9)__cgroup_bpf_detach(9)__cgroup_bpf_run_filter_skb(9)__cgroup_bpf_run_filter_sk(9)__cgroup_bpf_run_filter_sock_addr(9)__cgroup_bpf_run_filter_sock_ops(9)__cgroup_bpf_run_filter_sysctl(9)
mwah π that's the page, bestie β source/version: ./kernel/bpf, dated October 2026 π¦π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms