Skip to content

Commit

Permalink
sysfs: fall back to physical as logical clusters.
Browse files Browse the repository at this point in the history
On systems without SMT/hyperthreading use physical clusters
as the logical ones, ensuring that we always have logical
clusters if we have any.

Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub authored and askervin committed Jun 20, 2024
1 parent 38ece6d commit 307a338
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/sysfs/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,9 @@ func (sys *system) discoverPackages() error {
pkg.logicalClusters[die][first.cluster] = idset.NewIDSet(allHTCPUs.Members()...)
}
}
if len(pkg.logicalClusters) == 0 {
pkg.logicalClusters = pkg.clusterCPUs
}
}

return nil
Expand Down

0 comments on commit 307a338

Please sign in to comment.