compute_par...tive_cpumask(9)
๐ compute_partition_effective_cpumask(9) โ from the Kernel API Manual, bestie ๐
okay so picture this: it's a (9) manpage, it lives in the Kernel API Manual, and its whole personality is "figure out a partition's effective CPU mask." her name got a little chopped in the header (compute_par...tive_cpumask(9)) like she's texting from a bad signal, but she's iconic, we move. โจ
๐ธ NAME ๐ธ
compute_partition_effective_cpumask โ literally just computes effective_cpus for a partition. that's the whole gig, no cap ๐
๐ฆ SYNOPSIS ๐ฆ
void compute_partition_effective_cpumask (struct cpuset *cs , struct cpumask *new_ecpus );
like yes, that's the signature, copy it exactly, do NOT freestyle it ๐
๐ ARGUMENTS ๐
csโ the partition root cpuset. the main character of this whole operation ๐new_ecpusโ theeffective_cpusthat was previously computed, and which we're about to update. so she's not new-new, she's getting a glow-up โจ
๐ DESCRIPTION ๐
So here's the vibe: this function computes the effective_cpus of a partition root by scanning effective_xcpus of child partition roots and excluding their effective_xcpus. that's it, that's the math ๐งฎ
She's got a side effect though โ and it's a real one, so listen up: this has the side effect of invalidating valid child partition roots, if necessary. not me casually invalidating children ๐ญ but it's fine, it's on purpose.
Why is it fine? Because she's called from either cpuset_hotplug_update_tasks or update_cpumasks_hier, where parent and children are modified successively. so we don't need to call update_parent_effective_cpumask, and the child's effective_cpus will be updated in later iterations anyway. slay, deferred work, queen of not doing things twice ๐
๐ซถ little heads-up, bestie: rcu_read_lock is assumed to be held. assumed. like, she's trusting you. don't betray her. hold the lock fr fr.
๐ SEE ALSO ๐
Kernel file ./kernel/cgroup/cpuset.c, plus this absolutely stacked friend group ๐:
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)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!! ๐ she ships from ./kernel/cgroup, dated October 2026, and she's filed under compute_par...tive_cpumask(9). mwah, go hold that rcu lock, ily ๐ง๐
๐ฆ 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