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

T6703: add support for amd pstate driver #755

Merged
merged 1 commit into from
Sep 9, 2024
Merged

Conversation

nvollmar
Copy link
Contributor

@nvollmar nvollmar commented Sep 6, 2024

Change Summary

Building amd pstate driver in the kernel. By default the acpi_cpufreq will still take precedence over the amd_pstate driver.
Kernel command line arguments are required to activate the driver.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

https://vyos.dev/T6703

Component(s) name

kernel

Proposed changes

How to test

Set kernel arguments initcall_blacklist=acpi_cpufreq_init amd_pstate=passive on an AMD machine.
Then after boot verify the pstate driver is active: cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver should be amd-pstate

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Copy link

github-actions bot commented Sep 6, 2024

👍
No issues in PR Title / Commit Title

Copy link
Member

@dmbaturin dmbaturin left a comment

Choose a reason for hiding this comment

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

This PR is certainly a prerequisite for anything else we do to improve AMD support, but I wonder — we can't really expect most people to edit GRUB configs by hand, neither we should. Should there be a CLI for it, or an installer tweak to add those arguments if the machine uses an AMD CPU? Should we have a generic framework for such tweaks in the installer?

Also, what happens if one tries to load that driver on non-AMD machines?

@nvollmar
Copy link
Contributor Author

nvollmar commented Sep 6, 2024

@dmbaturin I added short explanation in the phabricator task. This just compiles the pstate driver into the kernel. But it won't be active unless you suppress the acpi one and load the AMD one. I think it just won't have any effect on non-AMD cpus, the system will work with the ACPI one suppressed just without any frequency scaling.

The necessary kernel arguments I plan to generate from a config command like vyos already has:

set system option kernel amd-pstate-driver (active|passive|guided)

This would also allow to validate that the system is using an AMD CPU before applying it.

@nvollmar
Copy link
Contributor Author

nvollmar commented Sep 6, 2024

Since it is completely option, it would be great to have that in Sagitta as well.
With the pstate driver enabled my Epyc is idling at 400-500Mhz instead of 1.5Ghz.

@c-po c-po merged commit 55c17f9 into vyos:current Sep 9, 2024
4 checks passed
@nvollmar nvollmar deleted the T6703 branch September 9, 2024 08:57
@c-po
Copy link
Member

c-po commented Sep 12, 2024

@Mergifyio backport circinus

Copy link

mergify bot commented Sep 12, 2024

backport circinus

✅ Backports have been created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants