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

backport cpufreq opts to 18.09 #53187

Merged

Conversation

cdepillabout
Copy link
Member

This backports #53041 to 18.09.

Here's the explanation from #53041:

This adds a NixOS option for setting the CPU max and min frequencies with cpufreq. The two options that have been added are:

  • powerManagement.cpufreq.max
  • powerManagement.cpufreq.min

It also adds an alias to the powerManagement.cpuFreqGovernor option as powerManagement.cpufreq.governor.

(cherry picked from commit b0f10d2)

Motivation for this change

It is nice to be able to set the cpu min and max frequencies with nixos options.

Ping @infinisil since he helped me with #53041.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.


powerManagement.cpuFreqGovernor = mkOption {
governor = mkOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should break the configuration within a release also it has an alias without a good reason.

Copy link
Member

@Mic92 Mic92 Jan 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding new options should be fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mic92 The alias allow users on 18.09 to upgrade to the new module name (powerManagement.cpufreq.governor) which will be used in 19.03 by default.

I don't think there is a good reason not to add this alias. I don't think adding an alias will break anyone's configuration?

Well, unless someone is already using the powerManagment.cpufreq.governor module name in one of their private configs? Maybe we want to be extra careful and make sure not to break this?

Although thinking about this, this should be similar to adding adding new configuration options (like powerManagement.cpufreq.max and powerManagement.cpufreq.min). I guess there isn't a huge difference between adding an alias and adding a new configuration option.

So I guess I am for adding the powerManagement.cpufreq.governor alias so that people can update their configurations while still using 18.09 in preparation for 19.03.

@cdepillabout
Copy link
Member Author

cdepillabout commented Jan 3, 2019

We should hold off on merging this because there was a problem found with TLP caused by this change: (this has been worked around in 0232f5c)

b0f10d2#commitcomment-31825338

This adds a NixOS option for setting the CPU max and min frequencies
with `cpufreq`.  The two options that have been added are:

- `powerManagement.cpufreq.max`
- `powerManagement.cpufreq.min`

(cherry picked from commit b0f10d2)
(cherry picked from commit 46ecec8)
@cdepillabout
Copy link
Member Author

I've updated this PR to not change the existing powerManagement.cpuFreqGovernor option. It also has been updated to not add the powerManagement.cpufreq.governor option.

All this current PR does is add two additional options:

  • powerManagement.cpufreq.max
  • powerManagement.cpufreq.min

@Mic92 This should fix your concerns with changing the current powerManagement.cpuFreqGovernor option.

@infinisil This should be ready for review. This is simply a backport of #53301 to 18.09.

@infinisil infinisil merged commit 876a2c7 into NixOS:release-18.09 Jan 8, 2019
@cdepillabout cdepillabout deleted the add-cpufreq-opts-to-18.09 branch January 8, 2019 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants