cpumask_random(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so bestie, welcome to the cpumask_random(9) page in the Kernel API Manual πŸ’– β€” this little icon does exactly one thing and does it slay: it gets you a random cpu in *src. that's the whole gig. no cap. ✨


πŸŽ€ SYNOPSIS πŸŽ€

unsigned int cpumask_random (const struct cpumask *src );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • src β€” a cpumask pointer 🫢 that's it, that's the argument. hand it a cpumask and it will vibe-check it for you.

πŸ”₯ RETURN πŸ”₯

it gives you back a random set bit, or >= nr_cpu_ids if src is empty πŸ’€

lowkey important: if src is empty you do not get a real cpu id back, you get something >= nr_cpu_ids. so if you were expecting an actual cpu, that's your sign to go check your mask, bestie πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

the kernel file ./include/linux/cpumask.h and its whole friend group, fr fr β€” every single one of these is on the invite list:


and that's the whole page, bestie β€” go pick a random cpu and slay πŸ’…βœ¨

xoxo, straight from ./include/linux, dated October 2026 πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from