kubernetes/pkg/kubelet/cm/topologymanager
Kevin Klues 155562dd2e Fix bug in TopologyManager with merging hints when NUM_NUMA > 2
Before this fix, hint permutations such as:

	permutation: [{11 true} {0101 true}]

Could result in merged hints of:

	mergedHint: {01 true}

This was possible because both hints in the permutation container a "preferred"
allocation (i.e. the full set of NUMA nodes set in the affinity bitmask are
*required* to satisfy the allocation). With this in place, the simplified logic
we had simply kept the merged hint as preferred as well.

However, what we really want is to ensure that the merged hint is only
preferred if *true* alignment of all resources is possible (i.e. if all hints
in the permutation are preferred AND their affinities are exactly equal).

The only exception to this is if *no* topology information is provided by a
given hint provider. In this case, we assume alignment doesn't matter and only
consider the resources that actually have hints provided for them.

This changes the semantics of permutations of the form:

	permutation: [{111 true} {011 true}]

To now result in the merged hint of:

	mergedHint: {011 false}

Instead of:

	mergedHint: {011 true}

This is arguably how it should always have been though (because a hint should
not be preferred if true alignment isn't possible), and two tests have had to
change to accomodate these new semantics.

This commit changes the merge function to implement the updated logic, adds a
test to verify it is functioning correctly, and updates the two tests mentioned
above to adjust to the new semantics.

Signed-off-by: Kevin Klues <kklues@nvidia.com>
2022-02-10 22:07:51 +00:00
..
bitmask hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
fake_topology_manager_test.go fix removing pods from podTopologyHints mapping 2021-05-10 19:44:15 +08:00
fake_topology_manager.go smtalign: cm: factor out admission response 2021-07-08 23:15:37 +02:00
OWNERS OWNERS cleanup - Jan 2021 Week 1 2022-01-10 08:14:29 -05:00
policy_best_effort_test.go Fix bug in TopologyManager with merging hints when NUM_NUMA > 2 2022-02-10 22:07:51 +00:00
policy_best_effort.go Update TopologyManager.Policy.Merge() to return a simple bool 2020-02-03 17:13:28 +00:00
policy_none_test.go Update TopologyManager.Policy.Merge() to return a simple bool 2020-02-03 17:13:28 +00:00
policy_none.go Update TopologyManager.Policy.Merge() to return a simple bool 2020-02-03 17:13:28 +00:00
policy_restricted_test.go Fix bug in TopologyManager with merging hints when NUM_NUMA > 2 2022-02-10 22:07:51 +00:00
policy_restricted.go simplify code in topologymanager 2020-03-28 00:04:51 +08:00
policy_single_numa_node_test.go Fix bug in TopologyManager with merging hints when NUM_NUMA > 2 2022-02-10 22:07:51 +00:00
policy_single_numa_node.go Fix staticchecks ST1005,S1002,S1008,S1039 in pkg/kubelet 2020-09-07 10:53:43 +08:00
policy_test.go Fix bug in TopologyManager with merging hints when NUM_NUMA > 2 2022-02-10 22:07:51 +00:00
policy.go Fix bug in TopologyManager with merging hints when NUM_NUMA > 2 2022-02-10 22:07:51 +00:00
scope_container_test.go Move scope specific tests from topologymanager under particular scopes 2020-11-12 12:25:55 +01:00
scope_container.go smtalign: cm: factor out admission response 2021-07-08 23:15:37 +02:00
scope_pod_test.go Move scope specific tests from topologymanager under particular scopes 2020-11-12 12:25:55 +01:00
scope_pod.go smtalign: cm: factor out admission response 2021-07-08 23:15:37 +02:00
scope_test.go fix removing pods from podTopologyHints mapping 2021-05-10 19:44:15 +08:00
scope.go smtalign: cm: factor out admission response 2021-07-08 23:15:37 +02:00
topology_manager_test.go smtalign: cm: factor out admission response 2021-07-08 23:15:37 +02:00
topology_manager.go smtalign: cm: factor out admission response 2021-07-08 23:15:37 +02:00