About virtual CPU-to-physical CPU pinning
Pinning each virtual CPU to a separate physical core can increase acceleration performance. We recommend that physical CPU 0 (zero) is not used for pinning virtual CPUs. Use the lscpu command to view the configuration of the physical cores on the KVM host. Find CPUs that share the same NUMA node (virtual CPU).
In this example physical CPUs 0 to 4 share node 0, physical CPUs 5 to 9 share node 1, physical CPUs 10 to 14 share node 2, and physical CPUs 15 to 19 share node 3.
NUMA node0 CPU(s): 0-4
NUMA node1 CPU(s): 5-9
NUMA node2 CPU(s): 10-14
NUMA node3 CPU(s): 15-19
Open the domain.xml file, and then add a <cputune> section to the file and assign each virtual CPU to a single, separate physical core. For example:
<cputune>
<vcpupin vcpu='0' cpuset='5'/>
<vcpupin vcpu='1' cpuset='6'/>
<vcpupin vcpu='2' cpuset='7'/>
<vcpupin vcpu='3' cpuset='8'/>
</cputune>
In this example, virtual CPU (or node) 0 is pinned to physical CPU 5, virtual CPU 1 is pinned to physical CPU 6, virtual CPU 2 is pinned to physical CPU 7, and virtual CPU 3 is pinned to CPU 8.
Save your changes to the domain.xml file, and then restart the virtual machine.