scx_bpf_tes...ear_cpu_idle(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… scx_bpf_test_and_clear_cpu_idle β€” NAME

okay so bestie, welcome to the Kernel API Manual ✨ β€” this one's called scx_bpf_test_and_clear_cpu_idle, and it does exactly what it says on the tin: test and clear @cpu's idle state πŸŽ€


🌸 SYNOPSIS

__bpf_kfunc bool scx_bpf_test_and_clear_cpu_idle (s32 cpu , const struct bpf_prog_aux *aux );

that's the whole signature, no cap πŸ‘‘


πŸ¦‹ ARGUMENTS

  • cpu β€” the cpu we're test-and-clearing the idle state for 🧚 like, this one right here
  • aux β€” the implicit BPF argument to access bpf_prog_aux, and it's hidden from BPF progs πŸ™ˆ so don't come looking for it, it's not for you

✨ DESCRIPTION

returns true if cpu was idle and its idle state was successfully cleared βœ… false otherwise πŸ’€ that's it, that's the vibe check.

🚨 important caveat, bestie, do not skip this: it's unavailable if ops.update_idle is implemented and SCX_OPS_KEEP_BUILTIN_IDLE is not set. like, literally not available. so if you're rolling your own idle handling, this function is not your main character 😭

πŸ‘‘ SEE ALSO

kernel file: ./kernel/sched/ext/idle.c β€” that's where the sauce lives πŸ“

and the whole friend group πŸ”₯:


mwah πŸ’œ that's the page! brought to you by ./kernel/sched/ext, dated October 2026 β€” go clear some idle states, bestie, ily 🫢

πŸ“¦ where this page comes from