cpuset_update_tasks_cpumask(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cpuset_update_tasks_cpumask(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so real talk, this is a page from the Kernel API Manual, and it's all about cpuset_update_tasks_cpumask. yes that's a mouthful, no i will not be shortening it, it's iconic and it knows it ✨


🌸 NAME 🌸

cpuset_update_tasks_cpumask β€” update the cpumasks of tasks in the cpuset. that's the whole vibe. one job, does it well, slays 🫢


✨ SYNOPSIS ✨

void cpuset_update_tasks_cpumask (struct cpuset *cs , struct cpumask
*new_cpus );

literally that's it. void return, no notes πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • cs β€” the cpuset in which each task's cpus_allowed mask needs to be changed. it's the main character here, giving "i contain multitudes (of tasks)" energy πŸ‘‘
  • new_cpus β€” the temp variable for the new effective_cpus mask. a little scratchpad, a little sidekick, doing the werk so cs can shine πŸŽ€

πŸ’– DESCRIPTION πŸ’–

so what actually happens? we iterate through each task of cs, updating its cpus_allowed to the effective cpuset's. and here's the key deets, no cap: this function is called with cpuset_mutex held, which is exactly why cpuset membership stays stable while we're walking the list. the lock is holding it down, fr fr πŸ”₯

⚠️ heads up bestie: the stability thing? it's because cpuset_mutex is held. don't go thinking it's stable for free, the lock is doing the heavy lifting πŸ’€

for top_cpuset, task_cpu_possible_mask is used instead of effective_cpus β€” and why? to make sure all offline CPUs are also included, because hotplug code won't update cpumasks for tasks in top_cpuset. so like, the offline girlies are still invited to the party πŸ™ˆ

and because task_cpu_possible_mask can be task dependent in arm64, we have to do cpu masking per task instead of doing it once for all. yeah. one at a time. individually. it's giving "we tried batching and it didn't work out" 😭


πŸ”₯ SEE ALSO πŸ”₯

okay this list is LONG, grab a snack πŸ“ β€” all of these live in the Kernel file ./kernel/cgroup/cpuset.c:

like i said. long. but every single one of them is a real one, go read them, iykyk πŸ’œ


and that's the page!! 🌈 this one comes to you from ./kernel/cgroup, dated October 2026, and it's filed under cpuset_update_tasks_cpumask(9) β€” mwah, go touch some cpumasks, ily πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from