__cgroup_bpf_replace(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __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 β€” a struct bpf_prog for 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:


mwah πŸ’‹ that's the page, bestie β€” source/version: ./kernel/bpf, dated October 2026 πŸ¦‹πŸ’–

πŸ“¦ where this page comes from