cpumask_first_zero(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cpumask_first_zero(9) ✨

okay so this is a page from the Kernel API Manual (that's the manual name, bestie, it's in the header, don't @ me) and it's about finding the first free cpu in a cpumask. that's it. that's the whole vibe. πŸŽ€


🌸 NAME 🌸

cpumask_first_zero β€” get the first unset cpu in a cpumask

like, the first cpu that isn't checked off. the empty seat in the group chat, if you will. πŸ‘‘


✨ SYNOPSIS ✨

unsigned int cpumask_first_zero (const struct cpumask *srcp );

literally one job, one call, one unsigned int coming back at u. πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • srcp β€” the cpumask pointer. that's the mask u are snooping through, bestie. hand it over and it does the searching for u. no cap.

🌈 RETURN 🌈

  • returns >= nr_cpu_ids if all cpus are set.

so like… if every single cpu is already taken, u get back a number that's >= nr_cpu_ids, which is the polite C way of being like "girl there is literally nothing left, go home". 😭 no free seats. sold out. πŸ’€


🫢 SEE ALSO 🫢

it's giving family reunion β€” every single relative showed up and u have to say hi to all of them. here's the whole guest list, from the kernel file ./include/linux/cpumask.h:

i know. it's a lot. drink some water. πŸ’œ


mwah πŸ’‹ that's the whole page β€” sourced from ./include/linux, dated October 2026, and yes u read that right, the future. main character energy fr fr. go find ur first zero, bestie. πŸ§šβ€β™€οΈβ­

πŸ“¦ where this page comes from