Skip to content

Commit

Permalink
count cpu packages correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Aug 7, 2024
1 parent a609ce7 commit 5c871ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tasks/sealsupra/supra_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ func GetSystemInfo() (*SystemInfo, error) {
for scanner.Scan() {
line := scanner.Text()

if packageRegex.MatchString(line) {
info.ProcessorCount++
}

if info.ProcessorCount > 1 {
// in multi-socket systems, we only care about the first socket, rest are the same
continue
Expand All @@ -102,10 +106,6 @@ func GetSystemInfo() (*SystemInfo, error) {
if puRegex.MatchString(line) {
threadCount++
}

if packageRegex.MatchString(line) {
info.ProcessorCount++
}
}

// Handle the last L3 cache
Expand Down

0 comments on commit 5c871ab

Please sign in to comment.