vCPU pinning with SMT

cjones

Active Member
Jun 28, 2019
28
1
43
I've been cross-referencing all kinds of posts and documentation to find a definitive answer to this, but it seems everybody does things just a tad differently with different syntax and I can't lock anything down. I'm trying to understand the proper combination of settings to pin vCPUs to a single CCX of an Epyc 7313 and retain SMT's benefits.

Currently, this the VM's CPU configuration parameters:
Code:
affinity: 12-15,28-31
args: -smp '8,sockets=1,cores=4,threads=2' -cpu 'host,kvm=off,+kvm_pv_eoi,+kvm_pv_unhalt,topoext=on,host-cache-info=on'
cores: 8
cpu: host

With this configuration, the guest does see a total of 8 CPUs comprised of 4 cores with 2 threads each. I just can't seem to wrap my head around pinning half the VM's cores to host threads 28-31. Is the VM assuming that it has 8 true cores at it's disposal when it's actually just a thread on the host (and consequently incurring a performance hit)? Is this configuration allowing SMT to be leveraged properly?
 
I have a script that may help:

https://github.com/kneutron/ansites...proxmox-vm-assign-cpu-cores-6-vcpu--8-pcpu.sh
https://github.com/kneutron/ansitest/blob/master/proxmox/psax

Just pass it a VMID (or it will show high cpu users and prompt) - I use it to pin a 3-thread VM to cores 7,6,5 on an 8-core to reduce latency. I also have a tweaked htop config so you can monitor, restore to root or /home/user .config/htop/htoprc

https://github.com/kneutron/ansitest/blob/master/proxmox/dot-config-htop-htoprc


From what I know, to try and keep things simple it's best not to involve "sockets" and just try to stick to "cores" unless you have a specific use case or licensing requirements
 
Last edited: