STRUCT CPUFREQ_COOLING_DEVICE(9)
π STRUCT CPUFREQ_COOLING_DEVICE(9) β¨
okay bestie, sit down, we're reading a manpage from the Kernel API Manual and honestly? it's kind of iconic. this is the struct that holds everything you need to know about a registered cpufreq_cooling_device π§ β yes, cooling, as in thermal, as in "please don't melt, little CPU." she's a keeper of state and she takes that job very seriously π
πΈ NAME
struct cpufreq_cooling_device β literally the data for a cooling device that works with cpufreq π
π¦ SYNOPSIS
struct cpufreq_cooling_device {
u32 last_load;
unsigned int cpufreq_state;
unsigned int max_level;
struct em_perf_domain *em;
struct cpufreq_policy *policy;
struct thermal_cooling_device_ops cooling_ops;
#ifndef CONFIG_SMP;
struct time_in_idle *idle_time;
#endif;
struct freq_qos_request qos_req;
};
no cap, that's the whole shape of her π (and yes, the #ifndef CONFIG_SMP and #endif are part of the vibe β copy them exactly, bestie, they're load-bearing π)
π Members
last_loadβ the load that was measured by the most recent call tocpufreq_get_requested_powerβ‘ like, the freshest tea we have.cpufreq_stateβ an integer value that represents the current state of cpufreq cooling devices ποΈ she knows where she is in life.max_levelβ the maximum cooling level β¨ and psst: it's one less than the total number of valid cpufreq frequencies (yes, one less, don't @ me).emβ a reference on the Energy Model of the device π main character energy model, honestly.policyβ the cpufreq policy π«Ά.cooling_opsβ the cpufreq callbacks that get handed to the thermal cooling device ops π she has connections.idle_timeβ the idle time stats π΄ the sleep tracker of the struct world.qos_reqβ the PM QoS constraint to apply π― boundaries, but make them performance-y.
β¨ Description
okay so this structure is required for keeping information of each registered cpufreq_cooling_device π that's it, that's the job β she's the memory-holder, the record-keeper, the "who are you and what are your thermal opinions" of the cpufreq cooling world. lowkey essential. highkey slaying. periodt π
π SEE ALSO
Kernel file ./drivers/thermal/cpufreq_cooling.c, plus all these besties who are also in the group chat:
struct time_in_idle(9)get_level(9)get_load(9)get_dynamic_power(9)cpufreq_get_requested_power(9)cpufreq_state2power(9)cpufreq_power2state(9)cpufreq_get_max_state(9)cpufreq_get_cur_state(9)cpufreq_set_cur_state(9)__cpufreq_cooling_register(9)cpufreq_cooling_register(9)of_cpufreq_cooling_register(9)cpufreq_cooling_unregister(9)
ngl the whole thing lives in ./drivers/thermal and this edition is dated October 2026 β so like, future-coded of her π¦
and that's the page bestie, ily, go forth and keep those CPUs cool π ππ
π¦ 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