css_set_move_task(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… css_set_move_task(9) β€” like, the manual page, but make it make sense πŸŽ€

okay bestie, so this is a page from the Kernel API Manual (that's the (9) part β€” kernel internals, not your grandma's ls), and today's main character is css_set_move_task. it moves a task from one css_set to another. that's it. that's the whole vibe. but bestie, the details?? immaculate. let's go πŸ¦‹


✨ NAME ✨

css_set_move_task β€” move a task from one css_set to another πŸ’«

literally what it says on the tin. no cap.


🌸 SYNOPSIS 🌸

void css_set_move_task (struct task_struct *task , struct css_set
*from_cset , struct css_set *to_cset , bool use_mg_tasks );

four arguments, returns nothing (void β€” it's giving "i do the work, i don't need applause", lowkey iconic πŸ’…). copy that signature exactly if you're writing anything against it, fr fr.


🫢 ARGUMENTS 🫢

  • task β€” the task being moved. our little traveler 🧳 she's the main character here.
  • from_cset β€” the css_set the task currently belongs to (and yes, this may be NULL πŸ™ˆ).
  • to_cset β€” the new css_set the task is being moved to (this one may be NULL too, we'll get to why).
  • use_mg_tasks β€” the little switch that decides where she lands: move her to to_cset->mg_tasks instead of ->tasks. that's the whole difference, periodt ✨

πŸ’– DESCRIPTION πŸ’–

so the actual job: move task from from_cset to to_cset. 🌈

a couple of edge cases that are very much by design, not bugs:

  • if task didn't belong to any css_set at all, then from_cset can be NULL. totally fine. she's starting fresh, no baggage πŸ’β€β™€οΈ
  • if task is being disassociated instead of moved, then to_cset can be NULL. yes, it's a one-way trip to nowhere, and the function is fine with that 🌸

now the part everyone forgets, so listen up bestie πŸ‘‘:

this function automatically handles the populated counter updates and the css_task_iter adjustments. that's the free stuff. but the caller is responsible for managing from_cset and to_cset's reference counts. that part is on you. do not make her do your homework, she will not. πŸ’€

so like β€” the function does the glow-up, you do the accounting. nobody said it was fair. πŸ™ˆ


πŸ”₯ SEE ALSO πŸ”₯

the whole kernel file lives at ./kernel/cgroup/cgroup.c, and honestly the friend group here is huge, so buckle up πŸŽ€:

like i said. huge friend group. iykyk 🌟


okay that's the whole page bestie, you ate that πŸ’œ and for the sign-off: this little beauty comes from the source spot ./kernel/cgroup and the version/date stamp on it is October 2026 β€” yes, from the future, she's ahead of her time, we stan a forward-thinking manpage 🧚⭐ slay! πŸŽ€

πŸ“¦ where this page comes from