Bug 492247 - Making explicit what power plans do
Summary: Making explicit what power plans do
Status: CLOSED INTENTIONAL
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_powerdevil (show other bugs)
Version: master
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-27 05:46 UTC by Alberto Salvia Novella
Modified: 2024-09-03 01:09 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alberto Salvia Novella 2024-08-27 05:46:24 UTC
On "Power Management", the naming of the power profiles could be more explicit about what they do, and what user case they are good for.

Currently:

Switch to power profile:
- Leave unchanged
- Power Save
- Balanced
- Performance

Example of improvement:

With performance:
- Unchanged
- Limited to save power
- Boosted when needed
- Always at maximum
Comment 1 Nate Graham 2024-08-27 19:50:32 UTC
Unfortunately we actually don't know exactly what these power profiles do or how they will affect system performance, which is why they're named somewhat generically. We don't know because we don't control the actual effects, which come from the device's firmware. So something like "Boosted when needed" might not actually be accurate, for example.
Comment 2 Alberto Salvia Novella 2024-08-27 22:51:45 UTC
@ Nate Graham

What's the point of having an option that nobody knows what it does? What's the purpose?

Is good enough having a technology that does something, if people cannot make use of it?

Also those profiles actually have specific definitions.

https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/blob/main/src/ppd-profile.h
 * @PPD_PROFILE_POWER_SAVER: "power-saver", the battery saving profile
 * @PPD_PROFILE_BALANCED: balanced, the default profile
 * @PPD_PROFILE_PERFORMANCE: as fast as possible, a profile that does
 *   not care about noise or battery consumption, only available
 *   on some systems.

https://wiki.archlinux.org/title/CPU_frequency_scaling#Scaling_governors:
- performance: Run the CPU at the maximum frequency, obtained from /sys/devices/system/cpu/cpuX/cpufreq/scaling_max_freq.
- powersave: Run the CPU at the minimum frequency, obtained from /sys/devices/system/cpu/cpuX/cpufreq/scaling_min_freq.
- userspace: Run the CPU at user specified frequencies, configurable via /sys/devices/system/cpu/cpuX/cpufreq/scaling_setspeed.
- ondemand: Scales the frequency dynamically according to current load. Jumps to the highest frequency and then possibly back off as the idle time increases.
- conservative: Scales the frequency dynamically according to current load. Scales the frequency more gradually than ondemand.
- schedutil: Scheduler-driven CPU frequency selection.

Hence my suggested definitions:

With performance:
- Unchanged
- Limited to save power
- Boosted when needed
- Always at maximum

Also it doesn't really matter if the definition is 100% accurate for all hardware, more than if it is explicit on its intention.
Comment 3 Nate Graham 2024-08-28 04:03:00 UTC
> What's the point of having an option that nobody knows what it does? What's
> the purpose?
Everybody knows *in general* what they do purely based on their names (save energy, balance of energy savings and performance, or maximum performance). Nobody know what *exactly* they do because the exact details are controlled by the device's firmware, like I said. Well, I suppose the firmware engineers know, but that doesn't help us!

> Also those profiles actually have specific definitions.
> 
> https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/blob/main/src/
> ppd-profile.h
>  * @PPD_PROFILE_POWER_SAVER: "power-saver", the battery saving profile
>  * @PPD_PROFILE_BALANCED: balanced, the default profile
>  * @PPD_PROFILE_PERFORMANCE: as fast as possible, a profile that does
>  *   not care about noise or battery consumption, only available
>  *   on some systems.
Right, these are the power profiles.

> https://wiki.archlinux.org/title/CPU_frequency_scaling#Scaling_governors:
> - performance: Run the CPU at the maximum frequency, obtained from
> /sys/devices/system/cpu/cpuX/cpufreq/scaling_max_freq.
> - powersave: Run the CPU at the minimum frequency, obtained from
> /sys/devices/system/cpu/cpuX/cpufreq/scaling_min_freq.
> - userspace: Run the CPU at user specified frequencies, configurable via
> /sys/devices/system/cpu/cpuX/cpufreq/scaling_setspeed.
> - ondemand: Scales the frequency dynamically according to current load.
> Jumps to the highest frequency and then possibly back off as the idle time
> increases.
> - conservative: Scales the frequency dynamically according to current load.
> Scales the frequency more gradually than ondemand.
> - schedutil: Scheduler-driven CPU frequency selection.
These are different, and unrelated to the power profiles feature. We can't know whether the firmware-specific implementation of the power profiles triggers any of these scaling governors to be used.

> Hence my suggested definitions:
> 
> With performance:
> - Unchanged
> - Limited to save power
> - Boosted when needed
> - Always at maximum
> 
> Also it doesn't really matter if the definition is 100% accurate for all
> hardware, more than if it is explicit on its intention.
What is it about the current descriptions that aren't obvious to you? To me, names like "Power save", "Balanced", and "Performance" are quite clear regarding what they'll do. Can you help me understand what the issue is here?
Comment 4 Alberto Salvia Novella 2024-08-28 23:28:41 UTC
What does "performance" mean?

If I run benchmark with either "balanced" or "performance", the results are the same within error.

I made the measurements with 6 probes, expressing errors accurately as:
https://jogomez-webs-upv-es.translate.goog/material/errores.htm?_x_tr_sl=es&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp

If I look at other people's benchmarks, the conclusions are the same. They cannot tell the difference.

The only difference I perceive is "performance" making the fans spin faster, but it doesn't seem to translate to any perceivable performance increase.

So my guess is that "performance" makes the CPU run at max freq all the time, and maybe setting a max turbo boost frequency. Which may translate to a sorter latency, but the same sustained performance.

But I cannot tell what is the user case for that. So the term "performance" is completely ambiguous, and people will chose it over "balanced" by mistake, when there is no evidence that sustains it will deliver any perceivable gain.
Comment 5 Nate Graham 2024-08-29 19:32:45 UTC
As I have been saying, what "performance" actually does will depend on the firmware. Maybe for you it changes the CPU governor and fan speed in a way that makes no difference. For someone else, it will do a different thing. We simply cannot describe in any more detail to the user what it will do, because we don't know, and we can't get that information from the firmware.

The fact that performance mode makes no difference for you or others definitely sounds like an issue with the way the vendor of your system has has chosen to implement performance mode. Alas, that doesn't come from KDE, again it comes from the vendor. That vendor may not care about Linux support at all and may be a black hole if contacted about it. And that would suck. But it would also be something one has to expect when one installs a Linux-based OS on a machine originally intended for Windows. If on the other hand, your vendor is a FOSS hardware company like Tuxedo, Slimbook, or KFocus, hopefully they will be more responsive and can actually fix the bug.

But I'm afraid there is nothing more we can do in KDE, sorry.
Comment 6 Alberto Salvia Novella 2024-09-02 13:53:37 UTC
On "Power Profiles Daemon" they have just updated the "readme" to better explain what the profiles do:

https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/merge_requests/205/diffs
---
Generally "power-saver" mode will limit performance to save power. While in "balanced" mode power-profiles-daemon will attempt to make changes to boost performance when needed. In "performance" mode performance will be maximized at the expense of power.
---

Something as basic as that will do!
Comment 7 Nate Graham 2024-09-02 14:19:33 UTC
I guess to me the names "power save", "balanced", and "performance" suggest all of that already.

i.e., if "power save" didn't attempt to save power at the expense of performance, what would it possibly do? And if "performance" didn't attempt to improve performance at the expense of power, what else would it possibly do?

And if those are the case, then clearly something named "balanced" attempts to negotiate some kind of balance between power savings and performance.
Comment 8 Alberto Salvia Novella 2024-09-02 15:17:20 UTC
I have seen several videos, and read several comments about how "performance" affected performance in a variety of hardware.

"Performance" never increased max clock speed, neither increased sustained performance or frames per second. For instance frequently they were decreased, due to higher heat.

What "performance" did was increasing idle clock speed, Turbo Boost speed, and prevented devices from going to idle.

That is it decreased latency, and never sustained performance. "Performance" means decreased latency, not max performance.

That's why "balanced" and "performance" are ambiguous. It suggests max performance, higher fps, instead of latency.

I think that saying that "balanced" boosts performance when needed is the missing detail.
Comment 9 Alberto Salvia Novella 2024-09-03 01:04:07 UTC
Okay, so trying to clarify this I ran different benchmarks:
- web.basemark.com
- mprep.info/gpu
- `sysbench cpu --threads="$(nproc)" run`
- `sysbench memory --threads="$(nproc)" run`

And with "balanced" and "performance" both showed the same results, with multiple probes, within error.

So I guess I cannot make conclusions of what "balanced" and "performance" means. On my system they perform exactly the same.
Comment 10 Alberto Salvia Novella 2024-09-03 01:05:19 UTC
"energy saving" shows half the performance.
Comment 11 Alberto Salvia Novella 2024-09-03 01:09:36 UTC
It seems to be the same case as:
https://www.reddit.com/r/microsoft/comments/t3c3ak/do_the_windows_power_plans_actually_affect_fps/