Nixpkgs: Enable schedutil cpufreq governor in default kernel builds?

Created on 24 May 2018  ·  9Comments  ·  Source: NixOS/nixpkgs

Could we set CONFIG_CPU_FREQ_GOV_SCHEDUTIL=m in default kernel builds?

Schedutil is a fairly new cpufreq governor which makes use of the cpu scheduler utilization data.

Most helpful comment

@worldofpeace I was off for a couple of days. Just got back to this. It does work now. I will open a PR in a little bit.

All 9 comments

This gets my vote!

cc @NeQuissimus ?

I can do that next week, I have no issue with the change

(if it's not done by Tuesday, somebody ping me, I will have forgotten :D)

I can do that next week, I have no issue with the change

Great! :+1:

@NeQuissimus But wouldn't there need to be some changes in the nixos modules also?

The module takes a generic string, as long as you drop the scheduler in there, it should be fine. I see no actual checks against the value in NixOS...

Alright, I am either brain-farting or missing something...

Even if I add

CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

and unset CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE.
I get this:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
performance powersave
systemctl status cpufreq.service                                                                                                                                             130 ↵
● cpufreq.service - CPU Frequency Governor Setup
   Loaded: loaded (/nix/store/39lp4azgkj7w5wrq88vdhz0m2kzryns8-unit-cpufreq.service/cpufreq.service; enabled; vendor preset: enabled)
   Active: active (exited) since Tue 2018-06-19 09:57:22 EDT; 1min 40s ago
  Process: 794 ExecStart=/nix/store/fbmwxflap8nicq07j7a0s2h4rdvdnlzw-cpupower-4.14.50/bin/cpupower frequency-set -g schedutil (code=exited, status=237/KEYRING)
 Main PID: 794 (code=exited, status=237/KEYRING)

Jun 19 09:57:22 nixus-desktop systemd[1]: Starting CPU Frequency Governor Setup...
Jun 19 09:57:22 nixus-desktop cpupower[794]: Setting cpu: 0
Jun 19 09:57:22 nixus-desktop cpupower[794]: Error setting new values. Common errors:
Jun 19 09:57:22 nixus-desktop cpupower[794]: - Do you have proper administration rights? (super-user?)
Jun 19 09:57:22 nixus-desktop cpupower[794]: - Is the governor you requested available and modprobed?
Jun 19 09:57:22 nixus-desktop cpupower[794]: - Trying to set an invalid policy?
Jun 19 09:57:22 nixus-desktop cpupower[794]: - Trying to set a specific frequency, but userspace governor is not available,
Jun 19 09:57:22 nixus-desktop cpupower[794]:    for example because of hardware which cannot be set to a specific frequency
Jun 19 09:57:22 nixus-desktop cpupower[794]:    or because the userspace governor isn't loaded?
Jun 19 09:57:22 nixus-desktop systemd[1]: Started CPU Frequency Governor Setup.

Can anybody else try this out?
Also, we will need to make this a PR that needs to be discussed.
As per https://cateee.net/lkddb/web-lkddb/CPU_FREQ_GOV_SCHEDUTIL.html the option is no longer a tristate, so we would need to change NixOS' default scheduler from performance. I don't think that is much of an issue but needs to be discussed (after we get this working in the first place :D)

Are you on an intel cpu?
Adding intel_pstate=passive to the kernel commandline might help.

@NeQuissimus ping :ping_pong:

@worldofpeace I was off for a couple of days. Just got back to this. It does work now. I will open a PR in a little bit.

Was this page helpful?
0 / 5 - 0 ratings