STRUCT AMD_CPUDATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct amd_cpudata(9) β€” like, the whole vibe

okay so bestie, welcome to the Kernel API Manual entry for struct amd_cpudata(9). this is the private CPU data situation for AMD P-State and honestly? it ate. let's get into it 🫢


✨ NAME ✨

struct amd_cpudata β€” the private CPU data for AMD P-State. that's it, that's the whole name, no notes πŸ’…


🌸 SYNOPSIS 🌸

struct amd_cpudata {
    int cpu;
    struct freq_qos_request req[2];
    u64 cppc_req_cached;
    u64 cppc_req2_cached;
    union perf_cached perf;
    u8 prefcore_ranking;
    u8 floor_perf_cnt;
    u8 bios_floor_perf;
    u32 min_limit_freq;
    u32 max_limit_freq;
    u32 nominal_freq;
    u32 max_freq;
    u32 lowest_nonlinear_freq;
    u32 floor_freq;
    struct amd_aperf_mperf cur;
    struct amd_aperf_mperf prev;
    u64 freq;
    bool boost_supported;
    bool hw_prefcore;
    u32 policy;
    bool suspended;
    u8 epp_default_ac;
    u8 epp_default_dc;
    bool dynamic_epp;
    bool raw_epp;
    struct notifier_block power_nb;
    enum platform_profile_option current_profile;
    struct device *ppdev;
    char *profile_name;
 };

look at her. iconic struct. every single field is right there, no skips, we respect all of them πŸ’–


πŸŽ€ Members πŸŽ€

okay so here's the cast, one by one, no cap:

  • cpu β€” the CPU number. which CPU she is, basically.
  • req β€” the constraint request to apply.
  • cppc_req_cached β€” cached performance request hints.
  • cppc_req2_cached β€” cached value of MSR_AMD_CPPC_REQ2. yes, the number-two register, we love a sequel.
  • perf β€” cached performance-related data.
  • prefcore_ranking β€” the preferred core ranking. higher value = higher priority, so like, the higher the value the more main-character the core is πŸ‘‘
  • floor_perf_cnt β€” the cached value of the number of distinct floor performance levels supported.
  • bios_floor_perf β€” the cached value of the boot-time floor performance level from MSR_AMD_CPPC_REQ2.
  • min_limit_freq β€” cached value of policy->min (in khz).
  • max_limit_freq β€” cached value of policy->max (in khz).
  • nominal_freq β€” the frequency (in khz) that mapped to nominal_perf.
  • max_freq β€” in ideal conditions, the maximum frequency (in khz) possible frequency. ideal conditions! manifesting ✨
  • lowest_nonlinear_freq β€” the frequency (in khz) that mapped to lowest_nonlinear_perf.
  • floor_freq β€” cached value of the user requested floor_freq.
  • cur β€” the difference of Aperf/Mperf/tsc count between the last and current sample.
  • prev β€” the last Aperf/Mperf/tsc count value read from the register.
  • freq β€” the current cpu frequency value (in khz).
  • boost_supported β€” checks whether the Processor or SBIOS supports boost mode.
  • hw_prefcore β€” checks whether HW supports the preferred core featue. only when hw_prefcore and the early prefcore param are true does the AMD P-State driver support the preferred core featue. so both conditions or it's a no πŸ’€
  • policy β€” the Cpufreq policy value.
  • suspended β€” if the CPU core if offlined. (yes, that's the original wording, we're keeping it fr fr πŸ™ˆ)
  • epp_default_ac β€” the default EPP value for the AC power source.
  • epp_default_dc β€” the default EPP value for the DC power source.
  • dynamic_epp β€” whether dynamic EPP is enabled.
  • raw_epp β€” whether the last EPP write was a raw numeric value rather than a named preference.
  • power_nb β€” the notifier block for power events.
  • current_profile β€” the currently selected platform profile option.
  • ppdev β€” the device registered with the platform profile handler.
  • profile_name β€” the name under which ppdev is registered.

πŸ¦‹ Description πŸ¦‹

so, amd_cpudata is literally the key private data for each CPU thread in AMD P-State, and it represents all the attributes and goals that AMD P-State requests at runtime. she's holding everything together. the way that one struct carries the entire runtime wishlist? obsessed πŸ˜­πŸ’œ


🌈 SEE ALSO 🌈

go peek at these, iykyk:

  • Kernel file ./drivers/cpufreq/amd-pstate.h
  • union perf_cached(9)
  • struct amd_aperf_mperf(9)

ok that's the whole page bestie, every field, every flag, nothing skipped πŸ’―

and that's a wrap! πŸŽ€ this little masterpiece came from ./drivers/cpufreq, dated October 2026, and it's brought to you by the Kernel API Manual β€” see you in the next one, mwah πŸ’‹πŸŒΈ

πŸ“¦ where this page comes from