feat(startos): persist a CPU energy/performance preference and apply it at boot - #3872
Conversation
d905d0e to
91086b4
Compare
e4b85a8 to
879fe96
Compare
c5e44e2 to
2e8491d
Compare
|
Design change, squashed to one commit ( The automatic boot default is gone: this now only applies an EPP the user has persisted via @dr-bonez your |
2e8491d to
a0c493f
Compare
|
Updated the boot default as requested in
I also added focused selector tests, updated the changelog and CLI reference, and corrected the PR description. This supersedes my earlier comment saying the automatic default was gone. |
7692f31 to
6163504
Compare
|
Moved both CPU power controls out of the experimental namespace: the commands are now Verified with the full start-core test suite (784 unit tests and 52 doctests), a start-cli build plus command-tree help assertions, Rust formatting, Prettier, and the StartOS docs build. |
|
Thanks — the approval is on the current head. CI is still running; no failures are reported so far. |
…it at boot `intel_pstate` and `amd-pstate` in active mode expose only the `performance` and `powersave` governors, so `GOVERNOR_HEIRARCHY` never matches and init sets nothing there. That is harmless — `powersave` is already the right governor on those drivers — but it means nothing ever touched EPP, the hint that actually decides how hard HWP chases a burst. Every such server runs on whatever its firmware left in the request register. On a Server Pro (Librem Mini v2, i7-10710U) PureBoot leaves `performance`: a 3% poll takes the package from 55 °C to 90 °C and back inside a second, 34 days had logged 24.9M package-throttle events, and the fan chased every excursion. Measured on that box under its steady-state workload, `balance_power` holds the clock at 2.0 GHz and never exceeded 58 °C; `balance_performance` still permits 82–90 °C spikes. `serverInfo.epp` persists a preference and init applies it at boot, warning if the driver does not offer it. `start-cli server experimental epp [<value>]` reads the live value and sets the persisted one. Nothing is changed unless a preference has been set: the right default is a per-device firmware decision, not an OS-wide one, and the Server Pro's is fixed in PureBoot. Machines whose driver exposes no EPP attribute read an empty set and are left alone. Every cpupower call at init — governor and EPP — now goes through `log_err()` rather than `?`, so a sysfs failure logs and moves on instead of dropping the server into Diagnostic Mode. `get_preferred_governor` becomes `preferred_governor`, taking the available set the caller already read. Also fixes `display_serializable(format, params)` in `system/mod.rs` and `ssh.rs`, which serialized the arguments instead of the result. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Helix-Harness: pi Helix-Model: openai-codex/gpt-5.6-sol
Helix-Harness: pi Helix-Model: openai-codex/gpt-5.6-sol
Helix-Harness: pi Helix-Model: openai-codex/gpt-5.6-sol
|
Rebased onto Post-rebase verification: |
6163504 to
9bd0971
Compare
Why
intel_pstateandamd-pstatein active/EPP mode expose only theperformanceandpowersavegovernors:So
GOVERNOR_HEIRARCHY(ondemand,schedutil,conservative) never matches andinit.rssets nothing — silently, the log line being inside theif let Some. That is harmless in itself:powersaveis the right governor on those drivers and the machine is already on it. What matters is that nothing ever touched EPP, the hint that actually decides how hard HWP chases a burst, so every such server runs on whatever its firmware left in the request register — and StartOS had no way to change it.On a Server Pro (Librem Mini v2, i7-10710U) PureBoot leaves
performanceon all 12 CPUs. A 3% aggregate poll took the package from 55 °C to 90 °C in under a second and back; 34 days of uptime had logged 24,881,470 package-throttle events, and the chassis fan chased every excursion, cycling every few seconds indefinitely.Measured
Same box, steady-state workload (mempool's 8-second poll plus bitcoind/electrs/Fulcrum), 50-second windows:
performance(PureBoot default)balance_performance(stock Linux default)balance_powerbalance_performancefixes the median but still lets the clock reach 3.9 GHz, so a real burst still spikes the die into the 80s — and the fan tracks spikes, not medians.balance_poweris the only value measured to stop the cycling on this hardware.The change
serverInfo.epppersists a preference (#[serde(default)], so existing databases deserialize). Init applies it at boot, warning if the driver does not offer that value.start-cli server epp [<value>]reads the live sysfs value and sets the persisted one, mirroringgovernor. It reports the live value because the persisted one isnullon every box that has not set it.balance_powerif the driver offers it. Other systems retain their current EPP. A saved preference always takes precedence.intel_pstatepassive, acpi-cpufreq, pre-HWP Intel — read an empty set and are left alone.The governor is deliberately untouched: the hierarchy falling through costs nothing on these drivers, and appending
powersavewould pin acpi-cpufreq boxes to minimum frequency.Review changes
Per dr-bonez: every fallible cpupower call at init — governor and EPP — goes through
log_err()rather than?, so a sysfs failure logs and moves on instead of dropping the server into Diagnostic Mode.get_preferred_governorbecamepreferred_governor, taking the available set the caller already read.The CPU governor and EPP commands now live directly under
start-cli server;server experimentalretains only the ZRAM command.Drive-by
display_serializable(format, params)atsystem/mod.rsandssh.rsserialized the command's arguments instead of its result —server governor --format jsonandssh list --format jsonboth returned the wrong object. Verified againstaction.rs.