bpf_cgroup_release(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’– bpf_cgroup_release(9) โ€” the Kernel API Manual, bestie edition ๐ŸŽ€

okay so real talk, this is bpf_cgroup_release(9) from the Kernel API Manual, and it's genuinely one of the most "hold my hand, we're letting go" functions in the whole BPF kfunc family. no cap.

โœจ NAME โœจ

bpf_cgroup_release โ€” release the reference you acquired on a cgroup. that's it, that's the vibe ๐Ÿ’…

but wait, there's a huge little asterisk here, and it's giving main character energy: if this kfunc is invoked inside an RCU read region, the cgroup is guaranteed to not be freed until the current grace period has ended โ€” even if its refcount drops to 0. so like, you let go, but the kernel's not gonna snatch it out from under you mid-read. iconic behavior honestly. ๐Ÿฆ‹

๐ŸŒธ SYNOPSIS ๐ŸŒธ

__bpf_kfunc void bpf_cgroup_release (struct cgroup *cgrp );

๐ŸŽ€ ARGUMENTS ๐ŸŽ€

  • cgrp โ€” the cgroup on which a reference is being released. like, the exact one you're saying bye to. don't @ the wrong one bestie ๐Ÿ˜ญ

๐Ÿ’œ SEE ALSO ๐Ÿ’œ

the kernel file ./kernel/bpf/helpers.c, and literally the entire extended friend group:

๐Ÿซถ friendly reminder: bpf_cgroup_acquire(9) is right there in the list for a reason โ€” if you release a reference you never acquired, that's not slay, that's a bug. ๐Ÿ˜ญ

and that's the whole page, bestie! โœจ this little gem lives in ./kernel/bpf, dated October 2026 โ€” write it on your arm, tell your friends, bpf_cgroup_release(9) periodt. ๐Ÿ’–๐ŸŒŸ๐Ÿ’…

๐Ÿ“ฆ where this page comes from