cgroup_css_set_fork(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 cgroup_css_set_fork(9) β€” NAME 🌸

okay so this page is from the Kernel API Manual, and it’s literally about finding or creating a css_set for a child process. bestie, it’s giving β€œwhere does this baby process belong in cgroup land” energy πŸ’…


✨ SYNOPSIS ✨

int cgroup_css_set_fork (struct kernel_clone_args *kargs );

πŸ’… ARGUMENTS πŸ’…

  • kargs β€” the arguments passed to create the child process 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

so here’s the tea: this function finds or creates a new css_set that the child process will be attached to in cgroup_post_fork. by default, the child process gets the same css_set as its parent β€” copy/paste energy, no cap 😌

if CLONE_INTO_CGROUP is specified, this function tries to find an existing css_set that includes the requested cgroup, and if it doesn’t find one, it creates a new css_set that the child will be attached to later. if this function succeeds, it will hold cgroup_threadgroup_rwsem on return 🫑

and if CLONE_INTO_CGROUP is requested, this function will grab the cgroup mutex before grabbing cgroup_threadgroup_rwsem, and it will hold a reference to the target cgroup. like, it’s not just vibing β€” it’s holding onto stuff πŸ”₯


πŸ”₯ SEE ALSO πŸ”₯

over in the kernel file ./kernel/cgroup/cgroup.c, the whole cgroup friend group is linked here β€” peek these, iykyk:


this lil page is sourced from ./kernel/cgroup, dated October 2026, and you’re reading cgroup_css_set_fork(9) in the Kernel API Manual β€” periodt, mwah πŸ’œπŸŽ€

πŸ“¦ where this page comes from