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
memory manager: specify the container cpuset.memory during the creation #98924
memory manager: specify the container cpuset.memory during the creation #98924
Conversation
@cynepco3hahue: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
Hi @cynepco3hahue. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/assign @klueska |
/ok-to-test |
/retest |
99ef69f
to
92ddcf7
Compare
92ddcf7
to
92859c1
Compare
|
||
// GetMemory provides NUMA nodes that used to allocate the container memory | ||
func (m *manager) GetMemoryNUMANodes(pod *v1.Pod, container *v1.Container) string { |
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.
It feels odd to have this return a string. I think (from an abstraction perspective) it would be better to return an []int
and do the conversion to a string at its point of use.
Or better yet, a sets.Int
to avoid the need for tmpNodes
below.
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.
good point!
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.
done
@@ -82,6 +81,9 @@ type Manager interface { | |||
// and is consulted to achieve NUMA aware resource alignment among this | |||
// and other resource controllers. | |||
GetPodTopologyHints(*v1.Pod) map[string][]topologymanager.TopologyHint | |||
|
|||
// GetMemory provides NUMA nodes that used to allocate the container memory |
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.
nit: s/nodes that used/nodes that are used/
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.
done
|
||
// GetMemory provides NUMA nodes that used to allocate the container memory |
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.
nit: s/nodes that used/nodes that are used/
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.
done
92859c1
to
f1d352a
Compare
@@ -31,5 +34,16 @@ func (i *internalContainerLifecycleImpl) PreCreateContainer(pod *v1.Pod, contain | |||
} | |||
} | |||
|
|||
if i.memoryManager != nil { | |||
numaNodes := i.memoryManager.GetMemoryNUMANodes(pod, container) | |||
if len(numaNodes) > 0 { |
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.
It's probably better to use numaNodes.Len()
here incase the underlying abstraction ever changes.
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.
done
if len(nodes) < 1 { | ||
klog.V(5).Infof("[memorymanager] update container resources is skipped due to memory blocks are empty") | ||
return nil | ||
if len(numaNodes) < 1 { |
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 would just do == 0
instead of < 1
here.
I would also explicitly return nil, to make it obvious that this is the exceptional case with no elements.
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.
done
Set the container cpuset.memory during the creation and avoid an additional call to the resources update of the container. Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
f1d352a
to
95b2777
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cynepco3hahue, klueska 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 |
Let me know when you get tests passing and I'll back through and do one more pass and add an LGTM |
/retest |
/test pull-kubernetes-node-kubelet-serial-memory-manager |
2 similar comments
/test pull-kubernetes-node-kubelet-serial-memory-manager |
/test pull-kubernetes-node-kubelet-serial-memory-manager |
/lgtm |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Set the container cpuset.memory during the creation and avoid an additional
call the resources update of the container.
Following the PR - #98019
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.:
Signed-off-by: Artyom Lukianov alukiano@redhat.com