STRUCT CPUDATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 value
  • update_util β€” CPUFreq utility callback information
  • update_util_set β€” CPUFreq utility callback is set
  • pstate β€” Stores P state limits for this CPU
  • vid β€” Stores VID limits for this CPU
  • last_update β€” Time of the last update.
  • last_sample_time β€” Last Sample time
  • aperf_mperf_shift β€” APERF vs MPERF counting frequency difference
  • prev_aperf β€” Last APERF value read from APERF MSR
  • prev_mperf β€” Last MPERF value read from MPERF MSR
  • prev_tsc β€” Last timestamp counter (TSC) value
  • sample β€” Storage for storing last Sample data
  • min_perf_ratio β€” Minimum capacity in terms of PERF or HWP ratios
  • max_perf_ratio β€” Maximum capacity in terms of PERF or HWP ratios
  • acpi_perf_data β€” Stores ACPI perf information read from _PSS
  • valid_pss_table β€” Set to true for valid ACPI _PSS entries found
  • iowait_boost β€” iowait-related boost fraction
  • epp_powersave β€” Last saved HWP energy performance preference (EPP) or energy performance bias (EPB), when policy switched to performance
  • epp_policy β€” Last saved policy used to set EPP/EPB
  • epp_default β€” Power on default HWP energy performance preference/bias
  • epp_cached β€” Cached HWP energy-performance preference value
  • hwp_req_cached β€” Cached value of the last HWP Request MSR
  • hwp_cap_cached β€” Cached value of the last HWP Capabilities MSR
  • last_io_update β€” Last time when IO wake flag was set
  • capacity_perf β€” Highest perf used for scale invariance
  • sched_flags β€” Store scheduler flags for possible cross CPU update
  • hwp_boost_min β€” Last HWP boosted min performance
  • suspended β€” 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, so acpi_perf_data, valid_pss_table and pd_registered only 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