find_cpu_id_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… find_cpu_id_range(9) πŸ’…

okay so bestie, this is a page from the Kernel API Manual and honestly? it's a little guy with a big job. let's get into it ✨


🌸 NAME 🌸

find_cpu_id_range β€” literally goes and finds you a linear range of @nthreads free CPU ids. that's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

int find_cpu_id_range (unsigned int nthreads , int assigned_node ,
       cpumask_var_t *cpu_mask );

like. look at that signature. so clean. so iconic. πŸ‘‘


🫢 ARGUMENTS 🫢

  • nthreads β€” the number of threads (cpu ids) you're asking for. it's an unsigned int, so no funny business with negatives, mmkay? πŸ’–
  • assigned_node β€” the node it belongs to, or NUMA_NO_NODE if free ids from any node can be peeked. yes bestie, you heard that right, you can just say "anywhere, idc" and it will go look around πŸ‘€βœ¨
  • cpu_mask β€” the returned CPU mask. this is the output, it's giving "here's your results, bestie" 🎁

πŸ’€ DESCRIPTION πŸ’€

Returns 0 on success. that's it. that's the description. no cap, it's a short one β€” but it's doing the most important thing and we respect it πŸ«‘πŸ’œ

ngl, if you were hoping for a novel here, there isn't one. the function succeeds and gives you 0. periodt.

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./arch/powerpc/platforms/pseries/hotplug-cpu.c β€” go read it, iykyk πŸ¦‹

and that's the whole page!! mwah πŸ’‹

this cutie lives under ./arch/powerpc/platforms/pseries and the docs are dated October 2026 β€” so go forth, find those free CPU ids, and slay πŸ’…πŸŒΈβ­

πŸ“¦ where this page comes from