From 307a338931f3ac129332fbbce5dfb2e997d54d1e Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Thu, 20 Jun 2024 09:13:36 +0300 Subject: [PATCH] sysfs: fall back to physical as logical clusters. 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 --- pkg/sysfs/system.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/sysfs/system.go b/pkg/sysfs/system.go index 84ce2da56..7d17ea646 100644 --- a/pkg/sysfs/system.go +++ b/pkg/sysfs/system.go @@ -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