cpuidle_cooling_runtime(9)
๐ cpuidle_cooling_runtime(9) โ like, the runtime computation one ๐งฎโจ
okay bestie, so this is a page from the Kernel API Manual (yes, that manual) and it's all about cpuidle_cooling_runtime. It's giving "small function, big math energy" and honestly? We're obsessed. ๐ซถ
โจ NAME โจ
cpuidle_cooling_runtime โ Running time computation ๐ซ
๐ธ SYNOPSIS ๐ธ
unsigned int cpuidle_cooling_runtime (unsigned int idle_duration_us ,
unsigned long state );
like, that's the whole signature. no cap. ๐
๐ ARGUMENTS ๐
idle_duration_usโ the CPU idle time you wanna inject, measured in microseconds. that's the vibe. โฑ๏ธstateโ a percentile based number. iykyk. ๐ข
๐ฆ DESCRIPTION ๐ฆ
so here's the tea โ โ the running duration gets computed from the idle injection duration, and that idle injection duration is fixed. periodt.
- if we hit 100% of idle injection ratio, that means the running duration is zero. like, gone. ๐
- if we've got a 50% ratio injection, that means we have equal duration for idle and for running duration. balanced. as all things should be. โ๏ธ
the formula is deduced as follows, and yes we're putting it in a code block because it's iconic:
running = idle x ((100 / ratio) - 1)
but for precision purpose for integer math, we use this one instead โ don't @ me, integer math is a whole situation ๐ญ:
running = (idle x 100) / ratio - idle
for example! if we have an injected duration of 50%, then we end up with 10ms of idle injection and 10ms of running duration. math ate that fr fr. ๐ฅ
๐ RETURN ๐
an unsigned int for a usec based runtime duration. so like, a number in microseconds. slay. ๐
๐ SEE ALSO ๐
- Kernel file
./drivers/thermal/cpuidle_cooling.cstructcpuidle_cooling_device(9) cpuidle_cooling_get_max_state(9)cpuidle_cooling_get_cur_state(9)cpuidle_cooling_set_cur_state(9)__cpuidle_cooling_register(9)cpuidle_cooling_register(9)
like, go read the whole thermal family bestie, they're all main characters. ๐ง
okay that's the whole page!! huge shoutout to ./drivers/thermal for being the source, October 2026 for the date, and cpuidle_cooling_runtime(9) for being the moment. mwah ๐โจ๐๐ฆ
๐ฆ 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