[vfio-users] After CPU pinning with libvirt, performance hasn't improved

Garrett Powell garretttracypowell at gmail.com
Sat Sep 12 15:55:51 UTC 2015


Per Alex's recommendation, I've switched from controlling QEMU directly to
using libvirt. I've been trying for the past few days to get CPU pinning to
work, but my performance hasn't improved. I should mention that my graphics
performance is fine. After reading through the entire thread at
virtualkvm.com, I've found a lot of people with similar issues but no
solutions that have worked for me. I'm using a single quad-core processor
with HT.

Here's part of my xml file:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  . . .
  <vcpu placement='static'>4</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='2'/>
    <vcpupin vcpu='1' cpuset='3'/>
    <vcpupin vcpu='2' cpuset='6'/>
    <vcpupin vcpu='3' cpuset='7'/>
  </cputune>
  . . .
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='2' threads='2'/>
  </cpu>
  . . .
</domain>

Here are the core ids for my CPUs (0-7):
$ cat /proc/cpuinfo | grep "core id"
core id : 0
core id : 1
core id : 2
core id : 3
core id : 0
core id : 1
core id : 2
core id : 3

Here are my kernel parameters:
GRUB_CMDLINE_LINUX_DEFAULT="isolcpus=2,3,6,7 intel_iommu=on
rd.driver.pre=vfio-pci"

Some things from the forum thread I tried:

   - Using <emulatorpin cpuset='2-3,6-7'/> in the xml file under <cputune>
   and removing "isolcpus" from my kernel parameters to set cpu affinity
   - Using "iommu=pt"
   - Using "nohz=off"


-Garrett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20150912/4508227b/attachment.htm>


More information about the vfio-users mailing list