STRUCT CPUDATA(9)
π struct cpudata(9) β the Kernel API Manual glow-up β¨
okay so bestie, meet struct cpudata, from the Kernel API Manual. it's literally the per-CPU instance data storage β every CPU gets its own little locker of state, and this struct is the locker. iconic behavior honestly π
πΈ NAME πΈ
struct cpudata β per CPU instance data storage. yes that's the whole name. she's simple, she's efficient, she's slaying π
β¨ SYNOPSIS β¨
here's the whole shape of her, verbatim, don't touch a single character or the compiler WILL come for you:
struct cpudata {
int cpu;
unsigned int policy;
struct update_util_data update_util;
bool update_util_set;
struct pstate_data pstate;
struct vid_data vid;
u64 last_update;
u64 last_sample_time;
u64 aperf_mperf_shift;
u64 prev_aperf;
u64 prev_mperf;
u64 prev_tsc;
struct sample sample;
int32_t min_perf_ratio;
int32_t max_perf_ratio;
#ifdef CONFIG_ACPI;
struct acpi_processor_performance acpi_perf_data;
bool valid_pss_table;
#endif;
unsigned int iowait_boost;
s16 epp_powersave;
s16 epp_policy;
s16 epp_default;
s16 epp_cached;
u64 hwp_req_cached;
u64 hwp_cap_cached;
u64 last_io_update;
unsigned int capacity_perf;
unsigned int sched_flags;
u32 hwp_boost_min;
bool suspended;
#ifdef CONFIG_ENERGY_MODEL;
bool pd_registered;
#endif;
struct delayed_work hwp_notify_work;
};
π¦ Members π¦
every field, one by one, no skipping, no cap:
cpuβ CPU number for this instance data. which CPU's locker this is π«Άpolicyβ CPUFreq policy valueupdate_utilβ CPUFreq utility callback informationupdate_util_setβ CPUFreq utility callback is setpstateβ Stores P state limits for this CPUvidβ Stores VID limits for this CPUlast_updateβ Time of the last update.last_sample_timeβ Last Sample timeaperf_mperf_shiftβ APERF vs MPERF counting frequency differenceprev_aperfβ Last APERF value read from APERF MSRprev_mperfβ Last MPERF value read from MPERF MSRprev_tscβ Last timestamp counter (TSC) valuesampleβ Storage for storing last Sample datamin_perf_ratioβ Minimum capacity in terms of PERF or HWP ratiosmax_perf_ratioβ Maximum capacity in terms of PERF or HWP ratiosacpi_perf_dataβ Stores ACPI perf information read from_PSSvalid_pss_tableβ Set totruefor valid ACPI_PSSentries foundiowait_boostβ iowait-related boost fractionepp_powersaveβ Last saved HWP energy performance preference (EPP) or energy performance bias (EPB), when policy switched to performanceepp_policyβ Last saved policy used to set EPP/EPBepp_defaultβ Power on default HWP energy performance preference/biasepp_cachedβ Cached HWP energy-performance preference valuehwp_req_cachedβ Cached value of the last HWP Request MSRhwp_cap_cachedβ Cached value of the last HWP Capabilities MSRlast_io_updateβ Last time when IO wake flag was setcapacity_perfβ Highest perf used for scale invariancesched_flagsβ Store scheduler flags for possible cross CPU updatehwp_boost_minβ Last HWP boosted min performancesuspendedβ Whether or not the driver has been suspended.pd_registeredβ Set when a perf domain is registered for this CPU.hwp_notify_workβ workqueue for HWP notifications.
π tiny heads-up for the girlies reading the synopsis: those#ifdef CONFIG_ACPI;and#ifdef CONFIG_ENERGY_MODEL;lines gate fields, soacpi_perf_data,valid_pss_tableandpd_registeredonly exist when those configs are in play. they're listed above anyway because we're being thorough. periodt.
π Description π
This structure stores per CPU instance data for all CPUs. that's it, that's the vibe β one of these per CPU, all of them holding that CPU's personal little stash of state. literally main character energy, multiplied by your core count π
π SEE ALSO π
go read these next, iykyk:
Kernel file ./drivers/cpufreq/intel_pstate.c struct sample(9), struct pstate_data(9), struct vid_data(9), struct global_params(9), struct pstate_funcs(9)
and that's the page bestie!! π this whole thing lives under ./drivers/cpufreq, dated October 2026, and it's filed as struct cpudata(9) β so if you ever need to find her again, that's the tag π mwah, go read struct sample(9) next, love u π§
π¦ 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