cpuset_cpus_allowed_locked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cpuset_cpus_allowed_locked(9) β€” the "you already hold the lock, bestie" edition πŸŽ€

okay so real talk, this one lives in the Kernel API Manual (section 9, kernel nerd territory) and it's genuinely one of the more chill functions in the cpuset saga. no cap.


✨ NAME ✨

cpuset_cpus_allowed_locked β€” literally just returns the cpus_allowed mask from a task's cpuset. that's it. that's the whole vibe. πŸ’–


🌸 SYNOPSIS 🌸

void cpuset_cpus_allowed_locked (struct task_struct *tsk , struct cpumask *pmask );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • tsk β€” pointer to a task_struct, and this is the task you're pulling cpuset->cpus_allowed from. like, whose mask do you want, bestie? this one. πŸ‘‘
  • pmask β€” pointer to a struct cpumask variable, and it's the lucky recipient that gets the cpus_allowed set dropped into it. main character energy for a variable, honestly. ✨

πŸ’œ DESCRIPTION πŸ’œ

so it's basically similar to cpuset_cpus_allowed β€” same idea, same destination β€” except there's one giant caveat: the caller must have already acquired cpuset_mutex. that's the whole "locked" thing in the name, iykyk. πŸ”’

ngl, if you haven't grabbed cpuset_mutex before calling this, that's a you problem and not the fun kind. it's called _locked for a reason, bestie. πŸ’€

🌈 SEE ALSO 🌈

the whole squad, fr fr β€” this function does not roll alone:

and where does all this magic live? kernel file ./kernel/cgroup/cpuset.c, obviously. πŸ“


later bestie!! πŸ’…βœ¨ this lil page comes from the source ./kernel/cgroup, dated October 2026, and it's filed under cpuset_cpus_allowed_locked(9) β€” go forth and please hold that mutex πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from