scx_bpf_task_cgroup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

Okay bestie, this is scx_bpf_task_cgroup(9) from the Kernel API Manual β€” and it does exactly what it says on the tin: Return the sched cgroup of a task.

✨ SYNOPSIS ✨

__bpf_kfunc struct cgroup * scx_bpf_task_cgroup (struct task_struct *p ,
const struct bpf_prog_aux *aux );

πŸŽ€ ARGUMENTS πŸŽ€

  • p β€” task of interest
  • aux β€” implicit BPF argument to access bpf_prog_aux hidden from BPF progs

πŸ¦‹ DESCRIPTION πŸ¦‹

So p->sched_task_group->css.cgroup represents the cgroup p is associated with from the scheduler's POV. SCX operations should use this function to determine p's current cgroup as, unlike following p->cgroups, p->sched_task_group is stable for the duration of the SCX op. See SCX_CALL_OP_TASK for details. Periodt πŸ’…

🌸 SEE ALSO 🌸

Kernel file ./kernel/sched/ext/ext.c, plus the whole squad:


mwah πŸ’‹ β€” source/version ./kernel/sched/ext, dated October 2026. You ate that, bestie 🫢

πŸ“¦ where this page comes from