STRUCT _THERMAL_STATE(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… struct _thermal_state(9)

okay bestie, so this is a page from the Kernel API Manual โ€” yep, the kernel has its own manual and she's serving struct realness โœจ


๐ŸŽ€ NAME ๐ŸŽ€

struct _thermal_state โ€” the whole vibe of "what's my CPU's thermal situation rn" in one struct, literally the current thermal event state ๐Ÿ‘‘


โœจ SYNOPSIS โœจ

struct _thermal_state {
    u64 next_check;
    u64 last_interrupt_time;
    struct delayed_work     therm_work;
    unsigned long           count;
    unsigned long           last_count;
    unsigned long           max_time_ms;
    unsigned long           total_time_ms;
    bool rate_control_active;
    bool new_event;
    u8 level;
    u8 sample_index;
    u8 sample_count;
    u8 average;
    u8 baseline_temp;
    u8 temp_samples[3];
 };

no cap, that's the whole thing. sixteen fields of pure thermal lore ๐Ÿซถ


๐Ÿ’– Members ๐Ÿ’–

okay so let's go through her field by field, iykyk:

  • next_check โ€” holds the next timestamp, which is when it's actually allowed to log the next warning message. like a "girl, not yet" timer โฐ
  • last_interrupt_time โ€” holds the timestamp for the last threshold high event. the receipts of when things got spicy ๐Ÿ”ฅ
  • therm_work โ€” the delayed workqueue structure. that's it, that's her job ๐Ÿงš
  • count โ€” holds the current running count for thermal or power threshold interrupts ๐Ÿ“Š
  • last_count โ€” holds the previous running count for thermal or power threshold interrupts. the before picture ๐ŸŽฌ
  • max_time_ms โ€” shows the maximum amount of time the CPU was in a throttled state for a single thermal threshold high-to-low state. the worst single glow-down ๐Ÿ˜ฎโ€๐Ÿ’จ
  • total_time_ms โ€” the cumulative time during which the CPU was in the throttled state. all the throttling, added up, together, as a family ๐Ÿ’€
  • rate_control_active โ€” set when a throttling message is logged. this exists for the purpose of rate-control. she's the "bestie we already said that" flag ๐Ÿ™ˆ
  • new_event โ€” stores the last high/low status of THERM_STATUS_PROCHOT or THERM_STATUS_POWER_LIMIT. status check, bestie โœ…
  • level โ€” stores whether this _thermal_state instance is for a CORE level or for PACKAGE level. main character energy vs. group chat energy, essentially ๐Ÿ‘‘
  • sample_index โ€” the index for storing the next sample in the buffer temp_samples[]. where the next lil temp reading goes ๐ŸŽ€
  • sample_count โ€” total number of samples collected in the buffer temp_samples[]. how many we got so far, fr fr ๐Ÿ”ข
  • average โ€” the last moving average of temperature samples. the smoothed-out vibe check ๐ŸŒก๏ธ
  • baseline_temp โ€” the temperature at which the thermal threshold high interrupt was generated. the origin story of the drama โญ
  • temp_samples โ€” storage for temperature samples used to calculate the moving average. a whole lil array comin' through ๐ŸŒˆ

๐Ÿฆ‹ Description ๐Ÿฆ‹

so this structure is used to represent data related to thermal state for a CPU. and like โ€” here's the cute part โ€” there's a separate storage for core level and package level for each CPU. so every CPU gets both a core-flavored one and a package-flavored one. slots for days ๐Ÿ’…

bestie note: this is just a description of what the struct holds โ€” the manpage isn't making promises about behaviour beyond that, so don't come for me if you assumed extra ๐Ÿ‘€

๐ŸŒธ SEE ALSO ๐ŸŒธ

  • Kernel file ./drivers/thermal/intel/therm_throt.c โ€” go read the source, she ate ๐Ÿ’–

and that's the page, bestie! this one's from ./drivers/thermal/intel, dated October 2026 โ€” so like, future slay ๐Ÿฆ‹โœจ periodt.

๐Ÿ“ฆ where this page comes from