update_pare...tive_cpumask(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 for partcmd_update. optional!! like a little accessory she might or might not wear πŸŽ€
  • tmp β€” temporary addmask and delmask. 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* and partcmd_disable commands are used by update_prstate. an error code may be returned, and the caller will check for that error. responsible queen behavior πŸ‘‘
  • the partcmd_update command is used by update_cpumasks_hier with newmask set to NULL, and by update_cpumask with newmask set.
  • partcmd_invalidate is used by update_cpumask with a NULL newmask.
⚠️ for those last ones β€” partcmd_update and partcmd_invalidate β€” the callers won't check for error, so partition_root_state and prs_err get 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