arch_set_cpu_capacity(9)
π
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 bestiecapβ how much capacitycpuhas at its maximum frequency, measured relative tomax_capπ₯max_capβ the system-wide maximum CPU capacity π the big one, the ceiling, the main charactercap_freqβ the frequency ofcputhat corresponds tocapβ‘base_freqβ the frequency ofcpuat 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 π¦
- Kernel file
./arch/x86/kernel/cpu/aperfmperf.cπ arch_enable_hybrid_capacity_scale(9)π
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
- 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