idle_cpu(9)
π€ 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):
task_prio(9)idle_task(9)find_process_by_pid(9)sched_setscheduler(9)sched_setscheduler_nocheck(9)sys_sched_setscheduler(9)sys_sched_setparam(9)sys_sched_setattr(9)sys_sched_getscheduler(9)sys_sched_getparam(9)sys_sched_getattr(9)sys_sched_setaffinity(9)sys_sched_getaffinity(9)sys_sched_yield(9)yield(9)yield_to(9)sys_sched_get_priority_max(9)sys_sched_get_priority_min(9)sys_sched_rr_get_interval(9)
π 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms