Skip to content
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

Automatically enter High Performance when plugged in #8

Open
cassidyjames opened this issue Apr 30, 2018 · 26 comments
Open

Automatically enter High Performance when plugged in #8

cassidyjames opened this issue Apr 30, 2018 · 26 comments
Assignees

Comments

@cassidyjames
Copy link

When connected to power (and perhaps once the battery is charged to a certain percent), we should switch into High Performance mode. I don't see a strong argument for trying to save power when connected to an effectively unlimited source.

Of course we should switch back to whichever profile the user had set if they disconnect power.

@DamianRivas
Copy link

Hi, thank you for the wonderful OS. Is this feature work in progress? I was looking into the power profiles in the system settings and noticed they don't automatically switch when plugging and unplugging the laptop. Google brought me here.

@mmstick mmstick mentioned this issue Sep 10, 2018
4 tasks
@mmstick mmstick mentioned this issue Sep 24, 2018
4 tasks
@mlncn
Copy link

mlncn commented Jun 12, 2019

Currently i find the option to leave on 'Balanced' (which seems to me to switch between High Performance and Battery Life based on whether it is plugged in) to be very good, and i use the option to override this by explicitly choosing Battery Life when plugged in (to keep it quieter if in a quiet room, was also pretty critical when my fan broke).

So from my perspective this is working exactly as i want, simply use Balanced to have it be automatic, but maybe "Balanced" isn't doing what i perceive it to be doing.

@mttkay
Copy link

mttkay commented Oct 20, 2019

I was looking into the power profiles in the system settings and noticed they don't automatically switch when plugging and unplugging the laptop.

+1

I think it's quite odd that when I unplug the power the laptop does not go into the Battery profile. Why is that? It would make so much sense and it's what all laptops did that I have owned over the past 10 years.

@DylanC
Copy link

DylanC commented Apr 9, 2020

Also interested in this feature! Its annoying to switch it every time I boot up.

jackpot51 added a commit that referenced this issue May 28, 2020
@dani763f
Copy link

+1 Also interested in this feature.
Plugged in = High performance mode
Disconnect AC = Battery mode
Should be default.

@stderr-to-devnull
Copy link

stderr-to-devnull commented Nov 8, 2020

Well, since this "feature" has been open from 2018, I can objectively deduce that asking nicely won't do the trick...

I'll just take my glib "write a script hurr durr" answer and move on with my life. Who needs usability and common sense in Linux where everyone is willing to search for hours on end on forums / github / reddit for solutions to problems that shouldn't exist in the first place?

Btw your POP shop is notifying me of operating system updates which is unable to install. It is a very sad irony. Well, off to the shell I go.

I know I know, it's free yadda yadda. It will, for the forseeable future, remain free and obscure. Bottom of the barrel one could say. That's Linux desktop experience in a nut...shell.

@stefanjaro
Copy link

This really should be a default feature.

I've written a Python script that does this and requires a bit of manual setup -
https://github.com/stefanjaro/popos-power-profile-adjustment

In short, if your battery is being charged but is below 50%, it'll set the profile to "Balanced". If it's above 50% it'll set it to "Performance". But if your battery is not being charged, it'll set the profile to "Battery".

@b-Tomas
Copy link

b-Tomas commented Dec 15, 2021

I agree. This should be the default behaviour.
Thanks @stefanjaro for sharing your script! Works great

@abuturabofficial
Copy link

This should have been the default behavior in the first place, rather there seems to be no development at all from 2018

@ghost

This comment was marked as off-topic.

@jacobgkau
Copy link
Member

@GlobalAlliance18 This is an issue tracker on a development platform. Please keep the discussion on-topic to the feature request; attacking System76 or "the open-source community" is not productive. Yes, Pop!_OS has many components that have been actively developed over the past few years, and the developers' time is split between all of them.

Thumbs-down reactions on a sarcastic, negative comment are not gatekeeping; they are reflective of the "be considerate" rule from the Pop!_OS Code of Conduct. Your opinion of the importance of this feature request is noted.

@ghost

This comment was marked as off-topic.

@mmstick
Copy link
Member

mmstick commented Feb 14, 2022

@GlobalAlliance18 I dropped this because I do not think it's a good idea. I've instead opted for a different approach to improving performance on AC that actually works. On modern Intel and AMD CPUs, the Balanced mode gives higher performance than High Performance. Automatically transitioning to High Performance not only slows down how fast a laptop can charge, but it limits the upper boost frequencies that cores can achieve. And regarding TLP, these days the Linux kernel already assigns dynamic runtime PM by default, which are considered optimal. System76-Power already applies the most optimal parameters for Balanced mode, many of which are kernel defaults.

@b-Tomas
Copy link

b-Tomas commented Feb 14, 2022

@mmstick May I ask why does the misleading high performance option still exists, or why is not balanced mode renamed? If I understood your comment well, there is no point on using the high performance mode, and I have been using a script that automatically changes the power settings when plugging to AC to realize now that the power options in the UI are not meant to be used. Am I wrong? Or is it that your update to the scheduler hasn't rolled out to the stable versions yet? I don't intend to be rude, I am just trying to understand what is going on here. Thank you.

@ghost

This comment was marked as off-topic.

@mmstick
Copy link
Member

mmstick commented Feb 14, 2022

@GlobalAlliance18 If you're willing to contribute PRs adding features you want to see, I would not be opposed to helping you get those features implemented. I have been busy on many other projects so this hasn't been a priority.

It also sounds like your laptop's firmware isn't handling pstate parameters well from Linux. Perhaps it is ignoring the parameters assigned by the balanced profile. There should not be any performance issues from using the default settings in Pop. Garbage is not how I'd described how well the balanced mode works with my own open firmware System76 laptop.

Most laptops you'll find are already operating at their highest TDP constraints, with no way of configuring that. They are also entirely limited by thermals, which can only be overcome through undervolting. Even on my own personal laptop, I can boost performance of my CPU by 50% simply by increasing airflow to the CPU with a blower attached to heatsink exhaust. The performance that I get is entirely dependent on the ambient room temperature and how much airflow I can get to its internal heatsinks, rather than the power profile I set.

The battery mode profile is useful because it constrains how often cache is flushed to disks, and limits CPU frequencies while disabling Intel turbo. The balanced mode has recommended defaults for all settings, including allowing the CPU to turbo and choose frequencies however it likes. This is the optimal setting for modern Ryzen and Intel processors because they have chipsets which automatically undervolt/underclock and overvolt/overclock cores dynamically based on CPU load and thermals. You can read about Ryzen Precision Boost Overdrive for more on how that works.

Which means that in practice, the balanced profile attains the highest performance in the widest variety of scenarios. On a highly-threaded workloads, thermal constraints are the limiting factor which throttles CPU frequencies. On lightly-threaded workloads, turbo is still pushing the busy cores as high as it can to reach thermal limits.

In the future, laptop vendors which support use of Linux with their products may support ACPI Platform Profiles. System76 Power currently sets this parameter if it exists, but as far as I know only a few Lenovo laptops support it. Firmware which supports it can use power profile data to configure their TDP, so they could offer a reduced TDP for Balanced and a higher TDP for High Performance.

System76 Scheduler is a separate project working to improve desktop responsiveness. It's not really related to System76 Power in any way. It has been released if you have the latest updates installed and haven't disabled the pop-shell extension. it gives CPU priority to actively-focused applications similar to what other OS's have been doing, and increases how often a context switch is performed, which results in the CPU spending more time on busy tasks in the foreground than on background services and applications.

@ghost

This comment was marked as off-topic.

@mmstick
Copy link
Member

mmstick commented Feb 15, 2022

This issue is about switching to the high performance profile. I decided not to continue pushing for the implementation for that because the balanced profile has the best performance anyway.

Not everyone wants their laptop to automatically switch to battery mode when unplugged. This would come at a major performance cost which wouldn't be necessary in most cases, and then there would be issue reports and complaints about how terrible Pop performs in comparison to {insert other distribution here}.

Android doesn't switch to battery mode until its battery has gotten to the last 10%, and it makes that a dialog request so the user has to consciously decide to do that. This feature would require more design and configuration file support.

System performance in Linux is 100% linked to firmware. You should not need a high performance CPU profile to have good performance. Technically when you query pstate files it will say that system76-power is using the powersave profile, but it tweaks the minimum and maximum frequencies, as well as the turbo mode feature. On balanced it's allowed to choose between 0% and 100% with turbo enabled. It's up to the firmware to decide how to leverage that info.

Firmware is also fully knowledgeable about the AC status, so there's nothing stopping firmware vendors from having their laptops choose a higher TDP automatically when on AC. That'd be better than relying on the kernel and userpsace software for that support in general.

If your system is having issues, it's because it's either ignoring these values or doing something else entirely. Wouldn't be the first time I've seen reports of laptops throttling the CPU on Linux.

My decision to work on Scheduler is unrelated. I started it in November in my free time outside of my usual work. It doesn't involve power profiles and I didn't feel the need to bump old bug reports that I wasn't thinking about to tell people about it when it's better to announce that on Reddit where everyone interested in that would get the announcement. It's a rewrite of a previous attempt that I made that I couldn't progress on because we were missing the pop-shell piece to make it possible.

@ghost

This comment was marked as off-topic.

@mmstick
Copy link
Member

mmstick commented Feb 15, 2022

If you are using cpufreq, that way of controlling the CPU governor was deprecated when Intel introduce the pstate driver. The pstate powersave profile already performs better than cpufreq perfomance profile while using less energy.

@ghost

This comment was marked as off-topic.

@mmstick
Copy link
Member

mmstick commented Feb 15, 2022

We don't assume anything. Since Pop began, we have evaluated every change ever introduced in a QA lab on multiple systems. I don't have control over the implementation of every laptop vendor's firmware. The only way I could help you is I were to start hardcoding specific board vendor+model IDs and doing alternative workarounds for firmware known to be buggy.

@ghost

This comment was marked as off-topic.

@ghost

This comment was marked as off-topic.

@pop-os pop-os locked as too heated and limited conversation to collaborators Mar 14, 2022
@jacobgkau
Copy link
Member

I have locked the issue from further discussion because the discussion is no longer productive. PRs are always welcome from anyone who wants to implement this or any other potential improvements.

@mmstick
Copy link
Member

mmstick commented Mar 14, 2022

@GlobalAlliance18

turned out to be completely incorrect

Probably because I just recently made updates to power profiles to give high performance a performance boost over balanced with tweaking the scaling governors. And there's an additional PR about to be merged which tweaks the scaling governor better for AMD and older Intel CPUs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.