scx_tg_sched(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

Welcome to scx_tg_sched(9) from the Kernel API Manual β€” the little function that resolves a task_group’s sched. It’s giving β€œwhere is your scheduling parent, bestie?” energy 🫢

scx_tg_sched β€” resolve a task_group’s sched.


✨ SYNOPSIS ✨

struct scx_sched * scx_tg_sched (struct task_group *tg );

πŸŽ€ ARGUMENTS πŸŽ€

  • tg β€” the task_group of interest πŸ‘€.

🌸 DESCRIPTION 🌸

Okay so scx_tg_sched() gives you back the sched that tg’s ops.cgroup_init succeeded on, and it returns NULL if tg isn’t inited. No cap.

An autogroup tg has no cgroup of its own and resolves to the root sched. Slay, inherited root-sched energy πŸ‘‘

When a child sched exits, its task_groups are moved to the parent and re-inited on it. A failed re-init fails the parent in turn and leaves the task_group without a sched it’s inited on, resolving to NULL. See scx_cgroup_return_subtree.

🚨 Bestie, that failed re-init path is real: the parent fails in turn, and the task_group ends up with no sched it’s inited on β€” so it resolves to NULL.

It’s safe for callers read-locking the ops rwsem. Rewrites of tg->scx.sched write-lock it, and tg on/offline can’t overlap such callers as a css’s files are created after online and drained before offline. Locking lore, lowkey iconic πŸ”βœ¨


πŸ¦‹ SEE ALSO πŸ¦‹

Okay the crossover episode list is LONG, bestie β€” every single one of these is here, no skipping, no cap πŸ’…

Kernel file: ./kernel/sched/ext/ext.c


xoxo, your local kernel bestie πŸ’… β€” signed off from ./kernel/sched/ext, October 2026, with scx_tg_sched(9) living rent-free in the manual 🫢✨

πŸ“¦ where this page comes from