minor tweak on numa node sorting algorithm
This commit is contained in:
		@@ -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()
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user