[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC DOCUMENT 07/12] kubevirt-and-kvm: Add CPU Pinning page
From: |
Andrea Bolognani |
Subject: |
[RFC DOCUMENT 07/12] kubevirt-and-kvm: Add CPU Pinning page |
Date: |
Wed, 16 Sep 2020 18:52:15 +0200 |
User-agent: |
Evolution 3.36.5 (3.36.5-1.fc32) |
https://gitlab.com/abologna/kubevirt-and-kvm/-/blob/master/CPU-Pinning.md
# CPU pinning
As is the case for many of KubeVirt's features, CPU pinning is
partially achieved using standard Kubernetes components: this both
reduces the amount of new code that has to be written and guarantees
better integration with containers running side by side with the VMs.
## Kubernetes CPU Manager
The Static policy allocates exclusive CPUs to pod containers in the
Guaranteed QoS class which request integer CPUs. On a best-effort
basis, the Static policy tries to allocate CPUs topologically in the
following order:
* Allocate all the CPUs in the same processor socket if available and
the container requests at least an entire socket worth of CPUs.
* Allocate all the logical CPUs (hyperthreads) from the same physical
CPU core if available and the container requests an entire core
worth of CPUs.
* Allocate any available logical CPU, preferring to acquire CPUs from
the same socket.
## KubeVirt dedicated CPU placement
KubeVirt relies on the Kubernetes CPU Manager to allocate dedicated
CPUs to the `virt-launcher` container.
When `virt-launcher` starts, it reads
`/sys/fs/cgroup/cpuset/cpuset.cpus` and generates `<vcpupin>`
configuration for libvirt based on the information found within.
However, affinity changes require `CAP_SYS_NICE` so this additional
capability has to be granted to the VM pod.
Going forward, we would like to perform the affinity change in
`virt-handler` (the privileged component running at the node level),
which would allow the VM pod to work without additional capabilities.
- [RFC DOCUMENT 00/12] kubevirt-and-kvm: Add documents, Andrea Bolognani, 2020/09/16
- [RFC DOCUMENT 01/12] kubevirt-and-kvm: Add Index page, Andrea Bolognani, 2020/09/16
- [RFC DOCUMENT 02/12] kubevirt-and-kvm: Add Components page, Andrea Bolognani, 2020/09/16
- [RFC DOCUMENT 03/12] kubevirt-and-kvm: Add Hotplug page, Andrea Bolognani, 2020/09/16
- [RFC DOCUMENT 04/12] kubevirt-and-kvm: Add Storage page, Andrea Bolognani, 2020/09/16
- [RFC DOCUMENT 05/12] kubevirt-and-kvm: Add Networking page, Andrea Bolognani, 2020/09/16
- [RFC DOCUMENT 06/12] kubevirt-and-kvm: Add Live Migration page, Andrea Bolognani, 2020/09/16
- [RFC DOCUMENT 07/12] kubevirt-and-kvm: Add CPU Pinning page,
Andrea Bolognani <=
- [RFC DOCUMENT 08/12] kubevirt-and-kvm: Add NUMA Pinning page, Andrea Bolognani, 2020/09/16
- [RFC DOCUMENT 09/12] kubevirt-and-kvm: Add Isolation page, Andrea Bolognani, 2020/09/16
- [RFC DOCUMENT 10/12] kubevirt-and-kvm: Add Upgrades page, Andrea Bolognani, 2020/09/16
- [RFC DOCUMENT 11/12] kubevirt-and-kvm: Add Backpropagation page, Andrea Bolognani, 2020/09/16
- [RFC DOCUMENT 12/12] kubevirt-and-kvm: Add Contacts page, Andrea Bolognani, 2020/09/16
- Re: [RFC DOCUMENT 00/12] kubevirt-and-kvm: Add documents, Philippe Mathieu-Daudé, 2020/09/22