alloc_cpumasks(9)
β¨ alloc_cpumasks β¨
okay so real talk, bestie β this is a page from the Kernel API Manual, section 9 (the kernel API girlies, iykyk), and it's all about alloc_cpumasks. it's lowkey iconic and honestly kind of a lifesaver. let's get into it π
πΈ NAME πΈ
alloc_cpumasks β allocate an array of cpumask variables
like, the whole entire point: you want a bunch of cpumasks? you get a bunch of cpumasks. periodt. β¨
π SYNOPSIS π
int alloc_cpumasks (cpumask_var_t *pmasks[] , u32 size );
she takes an array-of-pointers situation and a size, and she gives you back an int. that's the whole vibe check. π¦
π ARGUMENTS π
pmasksβ pointer to an array ofcpumask_var_tpointers. yes, it's pointers-to-pointers-to-... we know. it's giving inception but make it kernel. this is where your shiny new cpumasks are gonna land. π«Άsizeβ the number of cpumasks to allocate.u32, so she's got range π
π RETURN π
0if successful π-ENOMEMotherwise π
that's it. binary queen. no in-between, no "maybe", no "it's complicated".
β DESCRIPTION β
so here's the tea β β alloc_cpumasks allocates size cpumasks and initializes them to empty. clean slate, blank canvas, fresh start energy π§β¨
returns 0 on success, and -ENOMEM on allocation failure.
and listen β on failure, any previously allocated cpumasks are freed. she cleans up after herself, no leaked mess left behind. no cap, that's the good behavior we stan. π―
π₯ SEE ALSO π₯
these all live in the kernel file ./kernel/cgroup/cpuset.c, and honestly? it's a whole friend group. go say hi π
cpuset_lock(9)cpuset_full_lock(9)partition_is_populated(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(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 whole thing is brought to you by ./kernel/cgroup, dated October 2026 β so she's fresh, she's current, she's literally the moment. mwah π go allocate some cpumasks, slay, and remember: free what you alloc. love u, bye ππ·
π¦ 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