cgroup_transfer_tasks(9)
β¨ cgroup_transfer_tasks β like, the Kernel API Manual page you've been waiting for β¨
okay so this is a page straight out of the Kernel API Manual, and honestly? it's a little baddie. the way it just... moves tasks around. main character energy fr fr. let's get into it π
πΈ NAME πΈ
cgroup_transfer_tasks β move tasks from one cgroup to another π¦
like literally that's it, that's the whole vibe. pack your bags bestie, we're relocating.
β¨ SYNOPSIS β¨
int cgroup_transfer_tasks (struct cgroup *to , struct cgroup *from );
that's the whole signature, no cap. two pointers, one int, iconic. π
π ARGUMENTS π
toβ the cgroup you're sending the tasks to. the new address. the glow-up destination. π‘β¨fromβ the cgroup where the tasks are currently living. the old place. the "before" pic. π¦
π DESCRIPTION π
okay so here's the tea β β there are locking rules between cgroup_post_fork and the migration path, and they're doing so much work behind the scenes. the way that they guarantee stuff?? obsessed.
here's the promise, and it's a big one: if a task is forking while it's being migrated, the new child is guaranteed to end up in exactly one of two places β
- visible in the source cgroup after the parent's migration is complete, or
- put into the target cgroup. π―
either way, it's accounted for. no task can slip out of migration through forking. periodt. π no sneaky escape routes, no loopholes, nobody sliding out the back door. the vibe check is passed.
π₯ RETURN π₯
0on success π (slay)- a negative
errnocode on failure π (not slay, but at least it tells you what went wrong)
π«Ά SEE ALSO π«Ά
- Kernel file
./kernel/cgroup/cgroup-v1.cπ cgroup_attach_task_all(9)cgroupstats_build(9)task_get_cgroup1(9)
go read those too, iykyk π
aaaand that's the page!! π source-wise this beauty lives under ./kernel/cgroup, and it's dated October 2026 β so yeah, mark your calendars bestie, and go move some tasks π
πβ¨
π¦ 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