Support full-pcpus-only with the new NUMA distribution policy option

Signed-off-by: Kevin Klues <kklues@nvidia.com>
This commit is contained in:
Kevin Klues 2021-10-14 23:22:22 +00:00
parent d54445a84d
commit 70e0f47191

View File

@ -385,7 +385,11 @@ func (p *staticPolicy) podGuaranteedCPUs(pod *v1.Pod) int {
func (p *staticPolicy) takeByTopology(availableCPUs cpuset.CPUSet, numCPUs int) (cpuset.CPUSet, error) {
if p.options.DistributeCPUsAcrossNUMA {
return takeByTopologyNUMADistributed(p.topology, availableCPUs, numCPUs)
cpuGroupSize := 1
if p.options.FullPhysicalCPUsOnly {
cpuGroupSize = p.topology.CPUsPerCore()
}
return takeByTopologyNUMADistributed(p.topology, availableCPUs, numCPUs, cpuGroupSize)
}
return takeByTopologyNUMAPacked(p.topology, availableCPUs, numCPUs)
}