STRUCT CPUFREQ_COOLING_DEVICE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 to cpufreq_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:


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