update comments

This commit is contained in:
Charles Wong 2024-11-05 13:41:02 -06:00
parent 3f459f20d6
commit b86eb19d30
2 changed files with 5 additions and 3 deletions

View File

@ -561,11 +561,12 @@ func (a *cpuAccumulator) takeFullUncore() {
func (a *cpuAccumulator) takePartialUncore(uncoreID int) {
numCoresNeeded := a.numCPUsNeeded / a.topo.CPUsPerCore()
// note: we need to keep the first N free cores (physical cpus) and only we we got these expand to their
// cpus (virtual cpus). Taking directly the first M cpus (virtual cpus) leads to suboptimal allocation
// determine the N number of free cores (physical cpus) within the UncoreCache, then
// determine the M number of free cpus (virtual cpus) that correspond with the free cores
freeCores := a.details.CoresNeededInUncoreCache(numCoresNeeded, uncoreID)
freeCPUs := a.details.CPUsInCores(freeCores.UnsortedList()...)
// claim the cpus if the free cpus within the UncoreCache can satisfy the needed cpus
claimed := (a.numCPUsNeeded == freeCPUs.Size())
klog.V(4).InfoS("takePartialUncore: trying to claim partial uncore",
"uncore", uncoreID,
@ -594,6 +595,7 @@ func (a *cpuAccumulator) takeUncoreCache() {
return
}
// take partial UncoreCache if the CPUs needed is less than free UncoreCache size
a.takePartialUncore(uncore)
if a.isSatisfied() {
return

View File

@ -101,7 +101,7 @@ func (topo *CPUTopology) CPUNUMANodeID(cpu int) (int, error) {
return info.NUMANodeID, nil
}
// CPUInfo contains the NUMA, socket, unCoreCache and core IDs associated with a CPU.
// CPUInfo contains the NUMA, socket, UncoreCache and core IDs associated with a CPU.
type CPUInfo struct {
NUMANodeID int
SocketID int