Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 832224 - Gentoo Kernel: CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
Summary: Gentoo Kernel: CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard: 5.17.0, 5.16.5, 5.10.96, 5.4.176
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2022-01-28 20:02 UTC by Michael Hofmann
Modified: 2022-05-08 12:56 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Hofmann 2022-01-28 20:02:58 UTC
Users sometimes post their Gentoo kernel configuration in the Gentoo forums.

I frequently see:

   CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y

It's probably wrong, especially since some users report greatly reduced performance. It seems that CPUs run with the lowest CPU frequency available if userspace governor is selected and no userspace governor is available.

Where does this setting come from? I'm sure that it was not set by affected users. It must be either in the Gentoo kernel defaults - or it happens when users upgrade their Gentoo kernel.

Reproducible: Always
Comment 1 Mike Gilbert gentoo-dev 2022-01-28 20:18:50 UTC
It's been the default for x86_64 since this commit upstream:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5cb04df8d3f03e37a19f2502591a84156be71772

For the dist-kernel packages we use Fedora's config by default, which sets CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y.
Comment 2 Michael Hofmann 2022-01-28 20:55:54 UTC
Mike, thanks for your answer. What you write makes sense. I'm sure that Ingo Molnar knows what he is doing. Please close this ticket.

Just for reference: here is one of the threads where a user had severe problems with the governor "userspace":

https://forums.gentoo.org/viewtopic-t-1133148.html
Comment 3 Mike Pagano gentoo-dev 2022-01-29 00:26:13 UTC
(In reply to Michael Hofmann from comment #2)
> Mike, thanks for your answer. What you write makes sense. I'm sure that Ingo
> Molnar knows what he is doing. Please close this ticket.
> 
> Just for reference: here is one of the threads where a user had severe
> problems with the governor "userspace":
> 
> https://forums.gentoo.org/viewtopic-t-1133148.html

I think this is a good idea to switch to schedutil. 

I'm going to look deeper, but I can add this to our Gentoo Defaults set.
Comment 4 Mike Gilbert gentoo-dev 2022-01-29 00:39:05 UTC
Yeah, I don't think the userspace governor makes much sense as a default. I'm not sure the upstream change was intentional.
Comment 5 Larry the Git Cow gentoo-dev 2022-01-29 20:44:42 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=8216b19f52279d249d9233cb47bbcfff5b39fc56

commit 8216b19f52279d249d9233cb47bbcfff5b39fc56
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2022-01-29 20:43:23 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2022-01-29 20:43:23 +0000

    Select CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y as default
    
    Bug: https://bugs.gentoo.org/832224
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 4567_distro-Gentoo-Kconfig.patch | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Comment 6 Mike Pagano gentoo-dev 2022-01-31 13:06:59 UTC
This will go in with the kernels listed in the Whiteboard
Comment 7 Larry the Git Cow gentoo-dev 2022-02-01 18:37:17 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ced670280b0fe90b987a9221de5bac44a62bc30

commit 8ced670280b0fe90b987a9221de5bac44a62bc30
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2022-02-01 18:37:09 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2022-02-01 18:37:14 +0000

    sys-kernel/gentoo-sources: Linux version bumps and genpatches
    
    Linux 5.16.5
    Linux 5.15.19
    Linux 5.10.96
    Linux 5.4.176
    
    Select CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y as default
    
    Closes: https://bugs.gentoo.org/832224
    Package-Manager: Portage-3.0.30, Repoman-3.0.3
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 sys-kernel/gentoo-sources/Manifest                 | 12 ++++++++++
 .../gentoo-sources/gentoo-sources-5.10.96.ebuild   | 28 ++++++++++++++++++++++
 .../gentoo-sources/gentoo-sources-5.15.19.ebuild   | 28 ++++++++++++++++++++++
 .../gentoo-sources/gentoo-sources-5.16.5.ebuild    | 28 ++++++++++++++++++++++
 .../gentoo-sources/gentoo-sources-5.4.176.ebuild   | 28 ++++++++++++++++++++++
 5 files changed, 124 insertions(+)
Comment 8 Michael Hofmann 2022-03-21 15:05:37 UTC
Is this problem really fixed?

There are still users who complain that their machines run ONLY at the lowest CPU frequency, because their default scheduler is set to userspace.

See: https://forums.gentoo.org/viewtopic-t-1147736.html
Comment 9 Michael Hofmann 2022-03-21 15:13:38 UTC
Please replace "default scheduler" with "default governor" in my last post. 

Sorry.
Comment 10 Mike Pagano gentoo-dev 2022-03-21 22:37:17 UTC
They would need to come here and add some more information. I don't know the steps they followed or the kernel version
Comment 11 Michael Hofmann 2022-04-02 13:34:41 UTC
Two more users who noticed a massive slowdown after upgrading to a new kernel:

  https://forums.gentoo.org/viewtopic-t-1147952.html 

At least one of the used a gentoo-source kernel.

Both users report that the default governor was USERSPACE before and after the update. After the update, USERSPACE governor caused a performance degradation. 

Changing the default governor to schedutil or performace solved the problem.
Comment 12 Mike Pagano gentoo-dev 2022-04-02 17:06:00 UTC
(In reply to Michael Hofmann from comment #11)
> Two more users who noticed a massive slowdown after upgrading to a new
> kernel:
> 
>   https://forums.gentoo.org/viewtopic-t-1147952.html 
> 
> At least one of the used a gentoo-source kernel.
> 
> Both users report that the default governor was USERSPACE before and after
> the update. After the update, USERSPACE governor caused a performance
> degradation. 
> 
> Changing the default governor to schedutil or performace solved the problem.

Closing as there is not much more I can do here.
It looks like we cannot "select" something that is non-boolean or tristate symbols.

"Reverse dependencies can only be used with boolean or tristate symbols."

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/kbuild/kconfig-language.rst
Comment 13 Michael Hofmann 2022-05-07 20:55:53 UTC
Another user who became desperate with a very slow machine. 

His kernel: 5.15.26-gentoo
His CPU: Intel Core i7 4790K @ 4.00GHz

His frequency governor was set to "userspace". As a consequence, his CPU ran with 800 MHz only.

See: https://forums.gentoo.org/viewtopic-t-1149827.html
Comment 14 Mike Pagano gentoo-dev 2022-05-08 12:56:38 UTC
(In reply to Michael Hofmann from comment #13)
> Another user who became desperate with a very slow machine. 
> 
> His kernel: 5.15.26-gentoo
> His CPU: Intel Core i7 4790K @ 4.00GHz
> 
> His frequency governor was set to "userspace". As a consequence, his CPU ran
> with 800 MHz only.
> 
> See: https://forums.gentoo.org/viewtopic-t-1149827.html

Unless you have a suggestion that will solve this, then please stop.