cgroup_transfer_tasks(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 πŸ”₯

  • 0 on success πŸŽ‰ (slay)
  • a negative errno code on failure 😭 (not slay, but at least it tells you what went wrong)

🫢 SEE ALSO 🫢

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