cpuidle_cooling_runtime(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… 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 ๐ŸŒˆ

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