View previous topic :: View next topic |
Author |
Message |
ALF__ Apprentice

Joined: 30 Nov 2003 Posts: 252
|
Posted: Wed Aug 17, 2022 10:24 am Post subject: [Solved] Wrong settings for CPU frequency scaling? |
|
|
So, still hunting performance issues on a game im trying to play.
All points to that the graphics is set-up right.
However, i have started to maybe suspect that there might be some issues with the CPU frequency scaling instead.
Normally, i think at least, that there should be a way to monitor current frequency with like lscpu.
however, i do only have:
Code: |
CPU(s) scaling MHz: 22%
CPU max MHz: 3700,0000
CPU min MHz: 800,0000 |
And this seem to be static to 22%. even when i hit it with stress command, it stays at 22%.
Not sure if im just having the wrong power profile govenor in the kernel or am i missing something else maybe?
Kernel below:
https://pastebin.com/E2CBcxXR
Thanks!
Last edited by ALF__ on Thu Aug 18, 2022 10:01 am; edited 1 time in total |
|
Back to top |
|
 |
ALF__ Apprentice

Joined: 30 Nov 2003 Posts: 252
|
Posted: Wed Aug 17, 2022 11:08 am Post subject: |
|
|
Well, yes!
Changing "Default CPUFreq governor" to performance changed everything!
However, now it seems like scaling is pinned to above 98% all the time.
Good for performance, but probably not for power consumption at idle i guess?
What is the best, most efficient way to get this to adapt automatically? |
|
Back to top |
|
 |
mike155 Advocate

Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Wed Aug 17, 2022 11:34 am Post subject: |
|
|
Unfortunately, we see many kernels with CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y. At least on some machines, this results in CPU frequencies locked to the minimum CPU frequency.
I do think it's a bug and I reported it to the Gentoo developers: https://bugs.gentoo.org/832224. They told me to go away.
Switching the default governor to Performance, Ondemand, Powersave or Schedutil is the correct solution. Users usually don't run a userspace governor. Therefore, a governor "userspace" is complete and utter nonsense.
If you're concerned about power consumption: on most CPUs, there's no big difference between various CPU schedulers. Maybe one or two Watts. That may make a difference on ultra-thin notebooks or extreme low-power systems. But not on gaming notebooks, desktop machines, workstations or servers.
Much more important for power consumption are sleep states (C1, C2, ... C7). If a processor is idle, it should enter a sleep state. The deeper, the better. That reduces power consumption. It's important to enable sleep states in the BIOS settings and in your kernel. |
|
Back to top |
|
 |
logrusx Advocate


Joined: 22 Feb 2018 Posts: 3137
|
Posted: Wed Aug 17, 2022 12:09 pm Post subject: |
|
|
ALF__ wrote: | Well, yes!
Changing "Default CPUFreq governor" to performance changed everything!
However, now it seems like scaling is pinned to above 98% all the time.
|
Switch to schedutil.
mike155 wrote: | Unfortunately, we see many kernels with CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y. At least on some machines, this results in CPU frequencies locked to the minimum CPU frequency.
I do think it's a bug and I reported it to the Gentoo developers: https://bugs.gentoo.org/832224. They told me to go away.
|
Gentoo developers do not maintain kernel configs. They use Fedora's.
Regards,
Georgi |
|
Back to top |
|
 |
mike155 Advocate

Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Wed Aug 17, 2022 12:24 pm Post subject: |
|
|
logrusx wrote: | Gentoo developers do not maintain kernel configs. They use Fedora's. |
Fedora users don't seem to have the issue with locked-down frequencies. A wild guess: Fedora sets the correct governor in one of the boot scripts? |
|
Back to top |
|
 |
logrusx Advocate


Joined: 22 Feb 2018 Posts: 3137
|
Posted: Wed Aug 17, 2022 2:46 pm Post subject: |
|
|
mike155 wrote: | logrusx wrote: | Gentoo developers do not maintain kernel configs. They use Fedora's. |
Fedora users don't seem to have the issue with locked-down frequencies. A wild guess: Fedora sets the correct governor in one of the boot scripts? |
I have no idea what Fedora does. At first it had great configs for my laptop, then they messed them up. I modified and preserved an old version and migrate it to newer kernel versions.
We're moving a version or two behind Fedora, so some things might be messed for us and fixed for Fedora. You can find out more which version are we at in the ebuilds. You can also ask questions in #gentoo-kernel at Libera.char. |
|
Back to top |
|
 |
mike155 Advocate

Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Wed Aug 17, 2022 3:05 pm Post subject: |
|
|
@logrusx: are you a Gentoo developer? Then please tell me: why don't Gentoo developers fix this bug?
A Gentoo machine running with a governor "userspace" doesn't make sense if there is no userspace governor. Especially if it leads to severely reduced performance on some machines.
Last edited by mike155 on Wed Aug 17, 2022 4:02 pm; edited 1 time in total |
|
Back to top |
|
 |
logrusx Advocate


Joined: 22 Feb 2018 Posts: 3137
|
Posted: Wed Aug 17, 2022 3:15 pm Post subject: |
|
|
mike155 wrote: | @logrusx: are you a Gentoo developer? Then please tell me: why don't Gentoo developers fix this bug?
A Gentoo machine running with a governor "userspace" doesn't make sense if there is no userspace governor. Especially if leads to severely reduced performance on some machines. |
I am not and honestly, I haven't seen that "bug" recently.
p.s. this has gone off topic, can we stop that please. |
|
Back to top |
|
 |
ALF__ Apprentice

Joined: 30 Nov 2003 Posts: 252
|
Posted: Thu Aug 18, 2022 8:57 am Post subject: |
|
|
logrusx wrote: | ALF__ wrote: | Well, yes!
Changing "Default CPUFreq governor" to performance changed everything!
However, now it seems like scaling is pinned to above 98% all the time.
|
Switch to schedutil.
mike155 wrote: | Unfortunately, we see many kernels with CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y. At least on some machines, this results in CPU frequencies locked to the minimum CPU frequency.
I do think it's a bug and I reported it to the Gentoo developers: https://bugs.gentoo.org/832224. They told me to go away.
|
Gentoo developers do not maintain kernel configs. They use Fedora's.
Regards,
Georgi |
Hey!
schedutil seems to have done the trick. Now its no longer pinned, but reflect the current load instead.
However, one funny thing, it seems as the scaling never goes over 94%, even when running stress. Not sure if this is normal, expected or if there is a way to squeeze out the 6% missing?
Edit: Nah, I see when using emerge to update, it sometimes blips up to 100%, so guess its normal
On another note, its pretty funny that i used the machine for a while in 20% cpu mode.. Felt it was compiling the kernel for a couple of minutes more than my old i7. But never reflected more than that.
fluxbox runs lean, thats for sure. |
|
Back to top |
|
 |
logrusx Advocate


Joined: 22 Feb 2018 Posts: 3137
|
Posted: Thu Aug 18, 2022 9:48 am Post subject: |
|
|
ALF__ wrote: | logrusx wrote: | ALF__ wrote: | Well, yes!
Changing "Default CPUFreq governor" to performance changed everything!
However, now it seems like scaling is pinned to above 98% all the time.
|
Switch to schedutil.
mike155 wrote: | Unfortunately, we see many kernels with CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y. At least on some machines, this results in CPU frequencies locked to the minimum CPU frequency.
I do think it's a bug and I reported it to the Gentoo developers: https://bugs.gentoo.org/832224. They told me to go away.
|
Gentoo developers do not maintain kernel configs. They use Fedora's.
Regards,
Georgi |
Hey!
schedutil seems to have done the trick. Now its no longer pinned, but reflect the current load instead.
However, one funny thing, it seems as the scaling never goes over 94%, even when running stress. Not sure if this is normal, expected or if there is a way to squeeze out the 6% missing?
Edit: Nah, I see when using emerge to update, it sometimes blips up to 100%, so guess its normal
On another note, its pretty funny that i used the machine for a while in 20% cpu mode.. Felt it was compiling the kernel for a couple of minutes more than my old i7. But never reflected more than that.
fluxbox runs lean, thats for sure. |
Desktop users should not need anything other than schedutil. The instructs the CPU according to what the OS expects to be the load depending on what's being executed. Performance locks the highest frequency available, ondemand jumps back and forth between lowest and highest, powersave locks to the lowest, others are of no practical use for desktops.
No one CPU can work at 100% all the time, that's why there are those base frequencies, turbo boosts and so on nowadays. In the same time the readings for some CPU's are not quite accurate.
The funny thing is I didn't know how to switch performance modes on my laptop when I bought it. I didn't even know they existed, so I kept it at quiet but since I switched from a really old and slow computer, it felt like it was skyrocketing.
Regards,
Georgi |
|
Back to top |
|
 |
ALF__ Apprentice

Joined: 30 Nov 2003 Posts: 252
|
Posted: Thu Aug 18, 2022 10:01 am Post subject: |
|
|
Well, it was a fun solution.
Here I was, trying to hunt down issues with my graphics driver just to play an old game, and then i was running my CPU at 800mhz for over a year.
Pretty amazing.
Thanks everyone for your assistance! |
|
Back to top |
|
 |
Hu Administrator

Joined: 06 Mar 2007 Posts: 23651
|
Posted: Thu Aug 18, 2022 2:00 pm Post subject: |
|
|
ALF__ wrote: | Here I was, trying to hunt down issues with my graphics driver just to play an old game, and then i was running my CPU at 800mhz for over a year. | Clearly you do not run enough Web 2.0 applications. I can always tell when my laptop is stuck in powersave mode because all applications work great except for Firefox rendering certain heavy "Web 2.0" applications. Those run so slow that Firefox starts warning that the script is taking too long. (The laptop does not run modern games.) |
|
Back to top |
|
 |
pjp Administrator


Joined: 16 Apr 2002 Posts: 20629
|
Posted: Thu Aug 18, 2022 10:19 pm Post subject: |
|
|
mike155 wrote: | They told me to go away. | That's not a fair statement. An upstream configuration limitation was described, and an openness to solutions was indicated. Politely asking you to stop reporting "duplicate" incidents without a solution is not telling you to go away. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
 |
mike155 Advocate

Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Thu Aug 18, 2022 11:01 pm Post subject: |
|
|
@pjp: I'm sorry. I disagree.
- There's an issue:
Quote: | then i was running my CPU at 800mhz for over a year. |
I guess there are many machines out there with that problem - and I think it should be fixed.
I just installed sys-kernel/gentoo-sources and ran make menuconfig. CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y is still there. The issue has NOT been solved.
Here at Gentoo, I'm a support guy. I'm not a developer. It's NOT my job to fix bugs.
I reported the bug in Gentoo's database. And I proposed a solution.
Developers closed my bug - although the problem still persists.
One of the developers asked for more information.
That's why I posted links to forum threads where users complained about this. Developers could have gone to the forums and asked for information they needed. But they didn't do that.
Developers asked me to stop posting.
Please tell me: how can we proceed and get this bug fixed?
It's obvious that CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y is wrong if there's no governor running in userspace.
Various solutions come to my mind:
- we could change the default governor to schedultil (that's what I would do)
- we could make sure that boot scripts set the correct governor
- we could add a section to the handbook and tell users to set a default governor
- etc.
Any of these measures could be implemented. But we really should fix this bug - because we should give our users the best and fastest OS they can get. |
|
Back to top |
|
 |
|