cpuset_cpus_allowed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– cpuset_cpus_allowed(9) πŸ’–

okay bestie, welcome to the Kernel API Manual β€” yes it's a real manual, yes the name is giving "boring", no we are NOT skipping it. this is the page for cpuset_cpus_allowed, and honestly? it's a little icon.


✨ NAME ✨

cpuset_cpus_allowed β€” returns the cpus_allowed mask from a task's cpuset. that's it, that's the whole vibe πŸŽ€


🌸 SYNOPSIS 🌸

void cpuset_cpus_allowed (struct task_struct *tsk , struct cpumask
*pmask );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • tsk β€” pointer to a task_struct, and this is the task we're pulling cpuset->cpus_allowed from. she's the main character of this operation πŸ’…
  • pmask β€” pointer to a struct cpumask variable, and this lil one is the receiver 🫢 it's where the cpus_allowed set gets dropped off. think of it as the inbox.

πŸ‘‘ DESCRIPTION πŸ‘‘

so what actually happens? it returns the cpumask_var_t cpus_allowed of the cpuset that's attached to the tsk you handed over. simple, clean, no cap.

but here's the part you need to remember for the quiz πŸ“ β€” it is guaranteed to return some non-empty subset of cpu_active_mask. literally guaranteed. even if that means going outside the task's cpuset. yeah, she'll color outside the lines if she has to 😭

the one exception, the ONE time she won't do that: when the task is in the top cpuset. that's the sole carve-out, so don't come for her.

πŸ”₯ SEE ALSO πŸ”₯

all the siblings and cousins over in the kernel file ./kernel/cgroup/cpuset.c β€” go say hi, they're all family πŸ’œ


and that's the page, bestie 🌈 this lil drop of the Kernel API Manual came straight out of ./kernel/cgroup, dated October 2026 β€” screenshot it, cite it, live by it β­πŸ’–

πŸ“¦ where this page comes from