Fix core frequency setting logic for SRF and GNR#306
Merged
Conversation
…ks; update script definitions for GNR and SRF CPUs
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the core frequency setting logic by clearly separating the handling for SRF and GNR CPUs.
- Refactored the frequency retrieval commands for GNR (using tpmi and rdmsr) and SRF CPUs in internal/script/script_defs.go.
- Enhanced target validation and frequency setting logic in cmd/config/config.go by adding vendor, family, and model checks.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/script/script_defs.go | Refactored core frequency logic to distinguish between GNR and SRF CPU types |
| cmd/config/config.go | Updated core frequency setting logic to incorporate family/model/vendor checks |
Comments suppressed due to low confidence (1)
cmd/config/config.go:792
- Using 'range' on an integer literal is not valid Go syntax. Consider using a traditional loop such as 'for i := 0; i < 8; i++ {'.
for i := range 8 {
…cript definitions for SRF CPU
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the core frequency setting logic for SRF and GNR processors by separating the logic for each model and updating the corresponding frequency assignment commands.
- Updated shell script logic in script_defs.go to differentiate GNR and SRF behavior
- Enhanced core frequency configuration in config.go with conditional handling of the pstate driver and error reporting
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/script/script_defs.go | Separated GNR and SRF handling with distinct frequency sourcing and command usage |
| cmd/config/config.go | Added driver detection logic and updated frequency bin setting calculations |
Comments suppressed due to low confidence (1)
cmd/config/config.go:815
- The loop 'for i := range 8 {' is not valid Go syntax. Replace it with a standard for loop such as 'for i := 0; i < 8; i++ {'.
for i := range 8 {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.