-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
kubelet: memory manager: fix preferred topology hints calculation #104689
kubelet: memory manager: fix preferred topology hints calculation #104689
Conversation
…ation Prevent starting pods with resources satisfied by a single NUMA node on multiple NUMA nodes. The code returned before it updated the minimal amount of NUMA nodes that can satisfy the container requests. Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
/sig node |
/assign @klueska |
/test pull-kubernetes-unit |
/test |
@cynepco3hahue: The
The following commands are available to trigger optional jobs:
Use
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. |
/test pull-kubernetes-node-kubelet-serial-memory-manager |
@cynepco3hahue: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
/triage accepted |
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.
/lgtm
The memory manager lane fails because of the lack of a Dynamic Kubelet feature gate. |
This change makes caculating resources first to ensure set minAffinitySize correctly, looks nice. |
Can you explain this change a bit better? It's not immediately obvious from the code change what the old semantics were vs. what the desired new semantics should be. Which makes it hard to verify that the new semantics are correct. |
Sure, will try to explain it better. The problem is that during @klueska Please let me know if you need more details. |
// the node already in group with another node, it can not be used for the single NUMA node allocation | ||
if singleNUMAHint && len(machineState[maskBits[0]].Cells) > 1 { | ||
return | ||
} | ||
|
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 see. So basically you move this call below the loop (so we don't break out early), and then repurpose the loop to only update minAffinitySize
(if possible).
Then, if you make it through this loop (with a new minAffinity
or one equal to a previously calculated minAffinity
), only then do you go through the process of calculating the set of hints using (basically) the same logic you did before.
I didn't verify in this review that the existing logic is necessarily correct (I assume we did that in a previous PR), but the minor refactoring here seems makes sense.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cynepco3hahue, klueska, matthyx 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Prevent starting pods with resources satisfied by a single NUMA node on multiple NUMA nodes.
The code returned before it updated the minimal amount of NUMA nodes that can satisfy the container
requests.
Which issue(s) this PR fixes:
Fixes #104682
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
Signed-off-by: Artyom Lukianov alukiano@redhat.com