STRUCT IDLE_INJECT_DEVICE(9)
π struct idle_inject_device(9)
okay so this is a page from the Kernel API Manual, and we're talking about struct idle_inject_device β literally the vibe container for idle injection data. yes bestie, CPUs need naps too π
β¨ NAME β¨
struct idle_inject_device β the idle injection data struct. that's it, that's the whole name, iconic.
π¦ SYNOPSIS π¦
struct idle_inject_device {
struct hrtimer timer;
unsigned int idle_duration_us;
unsigned int run_duration_us;
unsigned int latency_us;
bool (*update)(void);
unsigned long cpumask[];
};
no cap, that's the whole shape of it. let's break down every single member because we do NOT skip π
πΈ Members πΈ
timerβ the idle injection period timer. she keeps the beat π₯idle_duration_usβ how long the injected CPU idle time lasts. the nap length, basically π΄run_duration_usβ how long the CPU is allowed to actually run. the grind length π₯latency_usβ the max allowed latency. don't let it go past this, fr.updateβ an optional callback that decides whether or not to skip idle injection in the given cycle. like a little vibe check gatekeeper π«Άcpumaskβ the mask of CPUs affected by idle injection. the guest list, and yes it's a flexible array member, slay.
π§ Description π§
This structure is used to define per instance idle inject device data. Each instance has an idle duration, a run duration, and a mask of CPUs to inject idle. one instance, one whole little setup, periodt.
The actual CPU idle time gets injected by calling the kernel scheduler interface play_idle_precise. that's the one doing the real work, we just respect her π
There is one optional callback that can be registered by calling idle_inject_register_full:
updateβ this callback is invoked just before waking up CPUs to inject idle. If it returnsfalse, the CPUs are not woken up to inject idle in the given cycle. It also lets the caller readjust the idle and run duration by callingidle_inject_set_durationfor the next cycle. so like, you get a say in your own destiny, lowkey iconic π
π SEE ALSO π
Kernel file ./drivers/powercap/idle_inject.c struct idle_inject_thread(9), idle_inject_wakeup(9), idle_inject_timer_fn(9), idle_inject_fn(9), idle_inject_set_duration(9), idle_inject_get_duration(9), idle_inject_set_latency(9), idle_inject_start(9), idle_inject_stop(9), idle_inject_setup(9), idle_inject_should_run(9), idle_inject_register_full(9), idle_inject_register(9), idle_inject_unregister(9)
go read all of them, iyktyk, they're all besties fr fr π«Άβ¨
π little sign-off from the ./drivers/powercap girlies: this page is dated October 2026, so it's giving future-forward main character energy. mwah π stay idle, stay iconic π
π₯
π¦ 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