本文将mark下KVM中的dedicated vCPUs hint KVM_HINTS_DEDICATED。

This feature introduces dedicated vCPUs(vCPU pinning, and there is no vCPU over-commitment) hint KVM_HINTS_DEDICATED, it has two users now:

  1. Waiman Long mentioned that:
    Generally speaking, unfair lock performs well for VMs with a small number of vCPUs. Native qspinlock may perform better than pvqspinlock if there is vCPU pinning and there is no vCPU over-commitment.

  2. vCPUs are very unlikely to get preempted when they are the only task running on a CPU. PV TLB flush is slower than the native flush in that case.


参考资料:

  1. Boosting Dedicated InstanceviaKVMTaxCut
  2. KVM: Introduce dedicated vCPUs hint KVM_HINTS_DEDICATED
  3. target-i386: adds PV_DEDICATED hint CPUID feature bit