idle_cpu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’€ idle_cpu(9) β€” like, is this CPU chilling rn?

ok so this is a page from the Kernel API Manual, and it's about idle_cpu ... which, bestie, is the most "no thoughts head empty" question you can ask the scheduler: is this CPU literally doing nothing right now? πŸ¦‹


✨ NAME ✨

idle_cpu β€” is a given CPU idle currently?

Like, present tense. Currently. It's a vibe check for a processor. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

int idle_cpu (int cpu );

Yup that's it. One arg, one int back. Iconic minimalism, no cap. ✨


🌸 ARGUMENTS 🌸

  • cpu β€” the processor in question. The one you're side-eyeing. The one whose whole situation you want the tea on. πŸ‘€

⭐ RETURN ⭐

  • 1 β€” if the CPU is currently idle. She's free. She's available. She's not doing anything rn. 😴
  • 0 β€” otherwise. She's busy, she's booked, she's got a runqueue to worry about. πŸ’€

That's the whole return contract, fr fr β€” just 1 or 0, no fancy negative-errno drama here.


πŸ”₯ SEE ALSO πŸ”₯

Also check out the Kernel file ./kernel/sched/syscalls.c, plus all these sibling pages if you wanna go down the scheduling rabbit hole (iykyk):


πŸ’– tiny note: this page lives in ./kernel/sched β€” that's her home, that's her whole address.

ok that's the whole page, you ate that 🫢 this cutie dropped in October 2026, filed under ./kernel/sched, and she answers to the name idle_cpu(9) β€” go forth and check your CPUs, bestie πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from