STRUCT _THERMAL_STATE(9)
๐ 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 ofTHERM_STATUS_PROCHOTorTHERM_STATUS_POWER_LIMIT. status check, bestie โlevelโ stores whether this_thermal_stateinstance 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 buffertemp_samples[]. where the next lil temp reading goes ๐sample_countโ total number of samples collected in the buffertemp_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
- 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