mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
minor tweak on numa node sorting algorithm
This commit is contained in:
parent
ecfa609b71
commit
445b9c0762
@ -812,14 +812,15 @@ func (m *ManagerImpl) filterByAffinity(podUID, contName, resource string, availa
|
|||||||
if nodes[i] != nodeWithoutTopology && nodes[j] != nodeWithoutTopology {
|
if nodes[i] != nodeWithoutTopology && nodes[j] != nodeWithoutTopology {
|
||||||
return perNodeDevices[nodes[i]].Len() < perNodeDevices[nodes[j]].Len()
|
return perNodeDevices[nodes[i]].Len() < perNodeDevices[nodes[j]].Len()
|
||||||
}
|
}
|
||||||
if nodes[i] != nodeWithoutTopology {
|
// If one or the other of nodes[i] or nodes[j] is the fake NUMA node -1 (they can't both be)
|
||||||
return true
|
if nodes[i] == nodeWithoutTopology {
|
||||||
}
|
|
||||||
if nodes[j] != nodeWithoutTopology {
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if nodes[j] == nodeWithoutTopology {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
// If both nodes[i] and nodes[j] are -1
|
// Otherwise both nodes[i] and nodes[j] are real NUMA nodes that are not in the 'hint's' affinity list.
|
||||||
return perNodeDevices[nodes[i]].Len() < perNodeDevices[nodes[j]].Len()
|
return perNodeDevices[nodes[i]].Len() < perNodeDevices[nodes[j]].Len()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user