What does cpu-pinning mean in context of KVM hypervisor with multiple virtual machines

affinitykvm-virtualizationpinning

I am looking at configuring a KVM hypervisor to have some virtual machines.

THe KVM hypervisor has 8 physical cores (16 with HyperThreading). I want to create 8 virtual machines on it but I am not able to understand what difference will cpu-pinning have on it.

What will be the difference when I pin each VM to a different core vs when I pin all the VMs to all the cores (by setting the affinity to cpu 0-15)

Will it have any performance benefits?

I guess I will have some caching benefits but will there be a difference if I want to run traffic to all the VMs?

Best Answer

CPU pinning ensures a VM will only get CPU time from a specific CPU or set of CPUs. Unless you have a very specific reason to pin, there usually is no need to do that.