update_pare...tive_cpumask(9)
π update_parent_effective_cpumask β from the Kernel API Manual, bestie
okay so picture this: we're deep in cpuset land, and this function right here is the glow-up artist for a parent cpuset's effective CPUs mask. it's giving "makeover montage but for CPU masks" β¨
π NAME
update_parent_effective_cpumask β update the effective_cpus mask of a parent cpuset. that's the whole vibe, no cap.
π¦ SYNOPSIS
int update_parent_effective_cpumask (struct cpuset *cs , int cmd ,
struct cpumask *newmask , struct tmpmasks *tmp );
π ARGUMENTS
csβ the cpuset that's requesting a change in partition root state. she's the main character of this whole operation πcmdβ the partition root state change command. this tells us what kind of transformation we're doing.newmaskβ optional new cpumask, specifically forpartcmd_update. optional!! like a little accessory she might or might not wear πtmpβ temporaryaddmaskanddelmask. scratch space, we love her π«Ά
β RETURN
0 or a partition root state error code. simple as that, fr fr.
πΈ DESCRIPTION
so here's the tea, bestie β this all depends on which cmd you're running. let's go one by one π§
β¨ partcmd_enable* β the becoming-a-partition-root era
the cpuset is being transformed from a non-partition root into a partition root β highkey a whole character arc π₯ the effective_xcpus mask (that's cpus_allowed if effective_xcpus isn't set) of the given cpuset gets taken away from the parent's effective_cpus. the function returns 0 if all the CPUs listed in effective_xcpus can be granted β otherwise you get an error code back. no free CPUs, no deal π
π partcmd_disable β the detransformation
the cpuset is going from a partition root back to a non-partition root. any CPUs sitting in effective_xcpus get given back to the parent's effective_cpus β like returning borrowed clothes, honestly π and 0 is always returned here. always. periodt.
π¦ partcmd_update β the glow-up-or-glow-down
if the optional newmask is specified, the cpu list changes from effective_xcpus to newmask. if she's not specified, then effective_xcpus is assumed to stay the same. the cpuset should be either a valid or an invalid partition root β both are allowed to be here, we don't gatekeep π the partition root state may flip from valid to invalid, or invalid to valid. but β and this is the important bit β an error code gets returned if transitioning from invalid to valid violates the exclusivity rule. rules are rules, bestie β
π partcmd_invalidate β the "you're so over" era
the current partition gets made invalid. that's it. that's the whole thing π
π§ who even calls this??
- the
partcmd_enable*andpartcmd_disablecommands are used byupdate_prstate. an error code may be returned, and the caller will check for that error. responsible queen behavior π - the
partcmd_updatecommand is used byupdate_cpumasks_hierwithnewmaskset toNULL, and byupdate_cpumaskwithnewmaskset. partcmd_invalidateis used byupdate_cpumaskwith aNULLnewmask.
β οΈ for those last ones βpartcmd_updateandpartcmd_invalidateβ the callers won't check for error, sopartition_root_stateandprs_errget updated directly instead. no error-checking safety net, she just raw-dogs it π
π SEE ALSO
literally all of these, bestie β the whole friend group:
Kernel file ./kernel/cgroup/cpuset.c
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), 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! she lives in ./kernel/cgroup, dropped October 2026 β go read the source, ily, 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