Skip to content

Fix core frequency setting logic for SRF and GNR#306

Merged
harp-intel merged 3 commits into
mainfrom
setbhsmaxfreq
Apr 22, 2025
Merged

Fix core frequency setting logic for SRF and GNR#306
harp-intel merged 3 commits into
mainfrom
setbhsmaxfreq

Conversation

@harp-intel
Copy link
Copy Markdown
Contributor

No description provided.

…ks; update script definitions for GNR and SRF CPUs
@harp-intel harp-intel requested a review from Copilot April 21, 2025 23:11
@harp-intel harp-intel linked an issue Apr 21, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 {

Comment thread cmd/config/config.go Outdated
@harp-intel harp-intel requested a review from Copilot April 21, 2025 23:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 {

Comment thread cmd/config/config.go
@harp-intel harp-intel merged commit f0ad32e into main Apr 22, 2025
2 checks passed
@harp-intel harp-intel deleted the setbhsmaxfreq branch April 22, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failure to set max core frequency on SRF and GNR

2 participants