-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable turbo/boost on battery profile when on battery #379
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree with unilaterally disabling turboboost when on battery. It can leave a ton of performance on the table, and the firmware should really be determining power limits when on battery.
Should this be a form of configuration option then? I've been recommended that auto-cpufreq has this behavior by default, and it was the main inspiration for creating it. |
Or perhaps it'd make sense to have this behavior for the battery profile |
I would be okay with that. |
In terms of system76 hardware, what systems would this apply to? |
All systems. Currently, turbo is disabled by default in the battery profile, so this will enable turbo when plugged into AC, and then disable it when unplugged. Seems to be of great benefit to Ryzen laptops at the moment since a lot of firmware is limiting the frequencies to 400 MHz in the amd-pstate powersave governor when boost is turned off. |
When I've been testing this, I've not been seeing evidence of boosted performance under the Battery Life profile while on AC. Looking at Pang11 and Dev One as specific test cases, I'm seeing the same results from benchmarks on AC regardless of profile, and a decrease in performance on battery in the Battery Life profile (always with %70 or greater charge) with this branch installed compared to before. I'm also seeing reported clock speeds the same on AC in particular both before and after this branch was installed on both systems when running benchmarks or even just running a stress command. The drop in performance under battery in the Battery Life profile is ~17% based on pulling numbers from a 7zip compression benchmark using phoronix test suite. That benchmark was selected as it seems to scale well with both clockspeeds and core counts. I would have expected, based on the comment that the battery profile axes turbo-boost generally at current, to see this increase AC performance under Battery Life, and maintain performance under battery powered conditions? |
To optimize battery life on laptops, it is recommended to disable hwp_dynamic_boost while on Battery Life profile, as it allows the CPU to conservatively boost it's clock rate and drains battery life faster. Reducing max_perf_pct to 30 or 40 is optimal for mid to lower-end laptops, while a setting of 20 is recommended for lower-end laptops. Implementing power profile switching based on AC power or battery status is a common and basic feature found in many OS's, and enabling it on Pop OS would be beneficial. While Pop OS is developed specifically for System76 computers, enabling these features or allowing users to make these changes through the command line or settings would be beneficial non-System76 users. Disabling hardware pstate boost and reducing max_perf_boost can significantly increase laptop battery life. |
On systems that do not limit the power draw when on battery, the turbo and boost feature can significantly increase energy consumption, due to increasing voltage(s) in the CPU to reach the boost frequencies. Some laptops are reportedly draining battery quickly as a result, even with mundane tasks. Balanced should strive to be more energy efficient when on battery, so I think it makes sense to disable it when on battery. It also makes sense to default to enabling it when plugged into a charger.
You can get the turbo value from intel_pstate from
/sys/devices/system/cpu/intel_pstate/no_turbo
, and the boost value for AMD from/sys/devices/system/cpu/cpufreq/boost
. May take a second or two for the event to propagate to the daemon.I've additionally included some code refactoring improvements in the daemon:
hotplug::Emitter
type to make it more readablecargo build --example hotplug && sudo target/debug/examples/hotplug
will run the new hotplug detect example.In the future, we might consider disabling turbo automatically when low on battery. And at some point replacing dbus with zbus. Along with configurable settings and GUI controls further down the road.
Cargo dependencies have also been updated.