Refine default thread selection for NUMA systems (#7322)

Until we have full NUMA support, this adjusts the default thread selection
algorithm to count up the number of performance cores across all sockets.
This commit is contained in:
Daniel Hiltgen 2024-10-30 15:05:45 -07:00 committed by GitHub
parent c826e57475
commit 16f4eabe2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 2121 additions and 6 deletions

View file

@ -175,6 +175,11 @@ func (si SystemInfo) GetOptimalThreadCount() int {
if len(si.System.CPUs) == 0 {
return 0
}
// Allocate thread count matching the performance cores on a single socket
return si.System.CPUs[0].CoreCount - si.System.CPUs[0].EfficiencyCoreCount
coreCount := 0
for _, c := range si.System.CPUs {
coreCount += c.CoreCount - c.EfficiencyCoreCount
}
return coreCount
}