cpuset_cpus_allowed(9)
π 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 atask_struct, and this is the task we're pullingcpuset->cpus_allowedfrom. she's the main character of this operation πpmaskβ pointer to astruct cpumaskvariable, and this lil one is the receiver π«Ά it's where thecpus_allowedset 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 π
cpuset_lock(9)cpuset_full_lock(9)partition_is_populated(9)alloc_cpumasks(9)alloc_tmpmasks(9)free_tmpmasks(9)dup_or_alloc_cpuset(9)free_cpuset(9)cpus_excl_conflict(9)cpuset_update_tasks_cpumask(9)compute_effective_cpumask(9)compute_effective_nodemask(9)rm_siblings_excl_cpus(9)update_parent_effective_cpumask(9)compute_partition_effective_cpumask(9)update_sibling_cpumasks(9)validate_partition(9)partition_cpus_change(9)update_cpumask(9)update_exclusive_cpumask(9)cpuset_update_tasks_nodemask(9)update_prstate(9)cpuset_css_alloc(9)cpuset_init(9)cpuset_hotplug_update_tasks(9)cpuset_handle_hotplug(9)cpuset_init_smp(9)cpuset_cpus_allowed_locked(9)cpuset_cpus_allowed_fallback(9)cpuset_mems_allowed(9)cpuset_nodemask_valid_mems_allowed(9)cpuset_nodes_allowed(9)cpuset_spread_node(9)cpuset_mem_spread_node(9)cpuset_mems_allowed_intersects(9)cpuset_print_current_mems_allowed(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms