From: Andrea Bolognani <abologna@redhat.com>
To: libvir-list@redhat.com, qemu-devel@nongnu.org
Cc: vromanso@redhat.com, rmohr@redhat.com, crobinso@redhat.com
Subject: [RFC DOCUMENT 07/12] kubevirt-and-kvm: Add CPU Pinning page
Date: Wed, 16 Sep 2020 18:52:15 +0200 [thread overview]
Message-ID: <640224075dc9c0ce5e1315e4769b48108822c084.camel@redhat.com> (raw)
In-Reply-To: <a6b5e34843b3f08994d4ffefadc5867001e0bc36.camel@redhat.com>
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.
next prev parent reply other threads:[~2020-09-16 16:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-16 16:44 [RFC DOCUMENT 00/12] kubevirt-and-kvm: Add documents Andrea Bolognani
2020-09-16 16:45 ` [RFC DOCUMENT 01/12] kubevirt-and-kvm: Add Index page Andrea Bolognani
2020-09-16 16:46 ` [RFC DOCUMENT 02/12] kubevirt-and-kvm: Add Components page Andrea Bolognani
2020-09-16 16:47 ` [RFC DOCUMENT 03/12] kubevirt-and-kvm: Add Hotplug page Andrea Bolognani
2020-09-16 16:48 ` [RFC DOCUMENT 04/12] kubevirt-and-kvm: Add Storage page Andrea Bolognani
2020-09-16 16:50 ` [RFC DOCUMENT 05/12] kubevirt-and-kvm: Add Networking page Andrea Bolognani
2020-09-16 16:51 ` [RFC DOCUMENT 06/12] kubevirt-and-kvm: Add Live Migration page Andrea Bolognani
2020-09-16 16:52 ` Andrea Bolognani [this message]
2020-09-16 16:53 ` [RFC DOCUMENT 08/12] kubevirt-and-kvm: Add NUMA Pinning page Andrea Bolognani
2020-09-16 16:54 ` [RFC DOCUMENT 09/12] kubevirt-and-kvm: Add Isolation page Andrea Bolognani
2020-09-16 16:55 ` [RFC DOCUMENT 10/12] kubevirt-and-kvm: Add Upgrades page Andrea Bolognani
2020-09-16 16:56 ` [RFC DOCUMENT 11/12] kubevirt-and-kvm: Add Backpropagation page Andrea Bolognani
2020-09-16 16:57 ` [RFC DOCUMENT 12/12] kubevirt-and-kvm: Add Contacts page Andrea Bolognani
2020-09-22 9:29 ` [RFC DOCUMENT 00/12] kubevirt-and-kvm: Add documents Philippe Mathieu-Daudé
2020-09-24 18:31 ` Andrea Bolognani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=640224075dc9c0ce5e1315e4769b48108822c084.camel@redhat.com \
--to=abologna@redhat.com \
--cc=crobinso@redhat.com \
--cc=libvir-list@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rmohr@redhat.com \
--cc=vromanso@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).