-
Notifications
You must be signed in to change notification settings - Fork 39.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated - topologymanager: Add Merge method to Policy #85798
Updated - topologymanager: Add Merge method to Policy #85798
Conversation
@nolancon: GitHub didn't allow me to request PR reviews from the following users: adrianchiris. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -105,21 +124,21 @@ func mergeProvidersHints(policy Policy, numaNodes []int, providersHints []map[st | |||
// If hints is nil, insert a single, preferred any-numa hint into allProviderHints. | |||
if len(hints) == 0 { | |||
klog.Infof("[topologymanager] Hint Provider has no preference for NUMA affinity with any resource") | |||
allProviderHints = append(allProviderHints, []TopologyHint{{nil, true}}) | |||
allProviderHints = append(allProviderHints, []TopologyHint{{defaultAffinity, true}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit of history here:
The reason we put defaultAffinity here instead of nil is simply because nil was introduced when adding SingleNumaNode policy since we had one merge logic that dealt with all policies.
since Single NUMA policy has now its own logic, this is no longer needed, thus we restore the original value.
Same applies for L#135,141
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think we should keep these semantics here. It makes it clear what the difference is between having a nil Affinity
field, an empty Affinity
field, and a full Afinity
field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, makes sense - I will update this.
…ogyHint' into specific policy tests.
…rom provider" into specific policy tests
…ogyHint from provider" into specific policy tests.
NUMANodeAffinity as nil" into specific policy tests.
NUMANodeAffinity as nil" into specific policy tests.
specific policy tests.
not 1/2" into specific policy test.
not 2/2" into specific policy tests
non-preferred hint matching" into specific policy tests
The logic has been updated to match the logic of the best-effort policy except in two places: 1) The hint filtering frunction has been updated to allow "don't care" hints encoded with a `nil` affinity mask, to pass through the filter in addition to hints that have just a single NUMA bit set. 2) After calculating the `bestHint` we transform "don't care" affinities encoded as having all NUMA bits set in their affinity masks into "don't care" affinities encoded as `nil`.
/approve I'm a big fan of being able to walk commit by commit through a PR and see all the final changes build up one-by one (instead of having a change in an earlier commit be overwritten by a later one). A good example of this is the breakdown for the moving of the tests in |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: klueska, nolancon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/kind cleanup |
What type of PR is this?
What this PR does / why we need it:
This PR is an updated version of #81586:
"In the current design the Topology Manager generates the merged
hints and select the best hint and the policy indicates whether
or not to admit the pod.
This patch adds Merge abstraction to Topology Manager policies which
allow the them to control on how to merge the permutation hints.
It also update the strict policy to admit only if all resources
aligned to same NUMA."
Now that #84721 has been merged, the changes proposed here are the original commits by @adrianchiris, but rebased to accommodate easier reviewing.
Related Issue: #83478
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: