cpumask_any(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cpumask_any(9) β€” like, the Kernel API Manual page, bestie ✨

okay so real talk, this is a page from the Kernel API Manual and it's genuinely so simple you're gonna be obsessed. it's cpumask_any and it does exactly one thing but it does it flawlessly. no notes. πŸŽ€


✨ NAME ✨

cpumask_any β€” pick an arbitrary cpu from *srcp

like... any cpu. whoever shows up. it's giving "you get a cpu, you get a cpu" energy πŸ¦‹


🌸 SYNOPSIS 🌸

cpumask_any (srcp );

literally that's it. that's the whole vibe check. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • srcp β€” the input cpumask πŸ’– this is the little squad of cpus you're handing over, and the function is gonna pick one out of the group. no cap.

πŸ¦‹ RETURN πŸ¦‹

returns >= nr_cpu_ids if no cpus set. 😭

bestie please hear me on this one: if your mask is empty (nobody's home, zero cpus set), you don't get a cpu, you get a value that's >= nr_cpu_ids β€” so like, always check, okay? don't just assume you got a valid cpu back. πŸ™ˆ

🌈 SEE ALSO 🌈

okay this is the part where the page goes absolutely feral with the cross-references, and honestly? iconic. the source file is ./include/linux/cpumask.h and here is the entire friend group, not one of them skipped, periodt πŸ‘‘

iykyk πŸ’œ


and that's the whole page, bestie β€” go pick a cpu, slay, and remember: empty mask means no cpu for you 😀🫢

with love from ./include/linux Β· October 2026 Β· the cpumask_any(9) girlies πŸ’…βœ¨

πŸ“¦ where this page comes from