kubernetes: align-by-socket and distribute-cpus-across-numa sometimes do not work together.
What happened?
Some of the alpha features for cpu manager, specifically the distribute-cpus-across-numa and the align-by-socket are not working together, when they should in theory.
To give some context, my system has two sockets, each one of which has two NUMA nodes, for a total of 4 NUMA nodes:
This is the CPU layout in my system. The NUMA nodes with the same color are the NUMA nodes that are on the same socket. In this case, there is 14 CPUs per NUMA node.
The problem is when I try to reserve 15 CPUs for a guaranteed QoS pod, where only CPU manager static policy is enabled, as well as the two features mentioned above. The problem is the CPUs that are allocated to a pod:
The CPU IDs in bold characters are the CPUs that are assigned to the pod: 1-2,5-6,9-10,13-14,29-30,33-34,37-38,42
While the distribute-cpus-across-numa is working correctly, it is not aligning by socket, since the CPUs assigned are not on the same socket.
What did you expect to happen?
I would expect that both the distribute-cpus-across-numa and the align-by-socket features to work simultaneously. There should also be aligning by socket. In other words, the pod CPUs should be:
Since they are on the same socket, but also distributing across numa
How can we reproduce it (as minimally and precisely as possible)?
- Set up system with two socket such that each socket uses up two NUMA nodes, for a total of 4
- Set up static policy on the kubelet with minimal kube-reserved and system-reserved, and the two alphaa features enabled: align-by-socket and distribute-cpus-across-numa
- Deploy a guaranteed QoS pod that requires 1 CPU above the amount of CPUs per NUMA node (in my case, I have 14 CPUs per NUMA node, so I request 15)
Anything else we need to know?
No response
Kubernetes version
$ kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.0", GitCommit:"b46a3f887ca979b1a5d14fd39cb1af43e7e5d12d", GitTreeState:"clean", BuildDate:"2022-12-08T19:58:30Z", GoVersion:"go1.19.4", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.0", GitCommit:"b46a3f887ca979b1a5d14fd39cb1af43e7e5d12d", GitTreeState:"clean", BuildDate:"2022-12-08T19:51:45Z", GoVersion:"go1.19.4", Compiler:"gc", Platform:"linux/amd64"}
Cloud provider
Cannot disclose
OS version
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, …) and versions (if applicable)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (10 by maintainers)
@ruquanzhao didn’t had bandwidth yet. Feel free to work and get in touch on slack/github. I’d be happy to help and review.
/triage accepted