arch_set_cpu_capacity(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… arch_set_cpu_capacity β€” from the Kernel API Manual, section 9 πŸŽ€

okay bestie, listen up, because this one is lowkey adorable and also deeply relevant to your hybrid CPU era ✨

🌸 NAME 🌸

arch_set_cpu_capacity β€” set the scale-invariance parameters for a CPU πŸ¦‹ literally what it says on the tin, no cap


✨ SYNOPSIS ✨

void arch_set_cpu_capacity (int cpu , unsigned long cap , unsigned long
max_cap , unsigned long cap_freq , unsigned long base_freq );

that's it, that's the whole vibe check πŸ’… five arguments, returns void, absolutely giving "I just fill in the numbers and go" energy πŸ™ˆ


πŸ’– ARGUMENTS πŸ’–

  • cpu β€” the target CPU 🎯 like, the one you're talking about, be specific bestie
  • cap β€” how much capacity cpu has at its maximum frequency, measured relative to max_cap πŸ”₯
  • max_cap β€” the system-wide maximum CPU capacity πŸ‘‘ the big one, the ceiling, the main character
  • cap_freq β€” the frequency of cpu that corresponds to cap ⚑
  • base_freq β€” the frequency of cpu at which MPERF counts 🌈 yes, MPERF, it's a real thing, iykyk

🧚 DESCRIPTION 🧚

okay so here's the tea πŸ“ the units you use for cap and max_cap genuinely do not matter β€” like, use potatoes, use vibes, use whatever β€” as long as they're consistent with each other, because cap is effectively divided by max_cap anyway. the ratio is what eats, not the units πŸ’…βœ¨

and it's the exact same story for cap_freq and base_freq β€” analogous, consistent, that's the whole rule πŸ“ two little pairs, each pair just has to agree with itself.

⭐ then, after you've called this for all the CPUs, call arch_rebuild_sched_domains so the scheduler knows capacity-aware scheduling can be used going forward 🫢 like, that's the official handoff, don't skip it, the scheduler is waiting for the text back 😭

πŸ¦‹ SEE ALSO πŸ¦‹


and that's the page, bestie!! brought to you by ./arch/x86/kernel/cpu, dated October 2026 πŸ—“οΈπŸ’– go forth and scale your invariances, mwah πŸ˜˜πŸŽ€

πŸ“¦ where this page comes from