UNION PERF_CACHED(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… union perf_cached β€” the kernel API manual, section 9, bestie 🫢

okay so picture this: it's a manual page from the Kernel API Manual, section 9, and it's all about one little union that holds the receipts on CPU performance data. yes ma'am, we're getting into the vibes of processor perf levels today ✨


🌸 NAME 🌸

union perf_cached β€” literally just a union whose whole job is to cache performance-related data. that's it, that's the gig πŸ’–


✨ SYNOPSIS ✨

union perf_cached {
    struct {
      u8 highest_perf;
      u8 nominal_perf;
      u8 lowest_nonlinear_perf;
      u8 lowest_perf;
      u8 min_limit_perf;
      u8 max_limit_perf;
      u8 bios_min_perf;
    };
    u64 val;
 };

look at her. iconic. a struct full of u8 cuties chilling inside a union with one big u64. main character energy fr fr πŸ‘‘


πŸŽ€ MEMBERS πŸŽ€

the anonymous one

  • {unnamed_struct} β€” bestie has no name, she's anonymous πŸ™ˆ (the manpage literally says anonymous, and honestly? mysterious of her)

the named girlies πŸ’…

  • highest_perf β€” the maximum performance an individual processor may reach, assuming ideal conditions. ok so here's the tea 🍡: for platforms that support the preferred core feature, the highest_perf value maybe configured to any value in the range 166-255 by the firmware (because the preferred core ranking is encoded in the highest_perf value). and to maintain consistency across all platforms, we split the highest_perf and preferred core ranking values into cpudata->perf.highest_perf and cpudata->prefcore_ranking. yes that's a whole lot, but it's important, don't skip it πŸ”₯
  • nominal_perf β€” the maximum sustained performance level of the processor, assuming ideal operating conditions. sustained, babes. she's in it for the long haul 🌈
  • lowest_nonlinear_perf β€” the lowest performance level at which nonlinear power savings are achieved. lowkey the most niche flex in here ⭐
  • lowest_perf β€” the absolute lowest performance level of the processor. the floor. the basement. the absolute bottom 🧚
  • min_limit_perf β€” cached value of the performance corresponding to policy->min πŸ“
  • max_limit_perf β€” cached value of the performance corresponding to policy->max πŸ¦‹
  • bios_min_perf β€” cached perf value corresponding to the "Requested CPU Min Frequency" BIOS option. yes, BIOS really said "let me set the min frequency" and this field is keeping the receipt πŸ’€
  • val β€” raw 64-bit value for atomic access via READ_ONCE/WRITE_ONCE. she's the whole union viewed as one number, and she's atomic about it. no cap πŸ”₯

πŸ‘€ SEE ALSO πŸ‘€

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

go read those too, iykyk πŸ’œ


ok final vibe check: val gives you atomic access to the whole thing, but the individual fields are the u8 girlies living inside that anonymous struct. know the difference, bestie 🫢

and that's the page!! πŸŽ€ this lil beauty comes to you from ./drivers/cpufreq, dated October 2026, and yeah she's filed under union perf_cached(9) β€” periodt πŸ’…βœ¨

πŸ“¦ where this page comes from