[vfio-users] CPU pinning with cgroups

Garrett Powell garretttracypowell at gmail.com
Mon Sep 7 01:19:03 UTC 2015


I've been having trouble with my guest freezing up, which I'm told is due
to a lack of CPU pinning. I'm currently trying to set up CPU pinning with
cgroups (specifically cpuset), but the freezing isn't going away. Could
anyone tell me what I'm doing wrong? I'm specifically referring to the
*cgcreate*, *cgset *and* cgexec* lines. Here's my launch script:

#!/bin/bash

export QEMU_AUDIO_DRV=pa
export QEMU_PA_SERVER=localhost
export PULSE_SERVER=localhost

vfio-bind 0000:06:00.0

synergys --daemon --config /etc/synergy.conf

for i in {0..3}; do
    echo performance >
/sys/devices/system/cpu/cpu${i}/cpufreq/scaling_governor
done

echo 5120 > /proc/sys/vm/nr_hugepages

cgcreate -g cpuset:kvm
cgset -r cpuset.cpus=0-3 -r cpuset.mems=0 -r cpuset.cpu_exclusive=1 kvm
cgexec -g cpuset:kvm qemu-system-x86_64 \
-enable-kvm \
-m 10240 \
-cpu host,kvm=off \
-smp sockets=1,cores=2,threads=2 \
-vga none \
-nographic \
-soundhw hda \
-name Windows10-VM \
-drive
if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd
\
-drive
if=pflash,format=raw,file=/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd
\
-device vfio-pci,host=03:00.0 \
-device vfio-pci,host=03:00.1 \
-device virtio-scsi-pci,id=scsi \
-drive
file=/home/garrett/VMs/Windows10/windows.img,id=disk,format=raw,if=none
-device scsi-hd,drive=disk \
-drive file=/home/garrett/VMs/Windows10/windows.iso,id=isocd,if=none
-device scsi-cd,drive=isocd \
-drive file=/home/garrett/VMs/Windows10/virtio-win.iso,id=virtiocd,if=none
-device ide-cd,bus=ide.1,drive=virtiocd \
-drive file=/mnt/storage/win-storage.img,id=storage,format=raw,if=none
-device scsi-hd,drive=storage \
-device vfio-pci,host=06:00.0
-usb -usbdevice host:0d8c:0014

pkill synergys

echo 0 > /proc/sys/vm/nr_hugepages

for i in {0..3}; do
    echo powersave >
/sys/devices/system/cpu/cpu${i}/cpufreq/scaling_governor
done


Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20150907/7da2e61d/attachment.htm>


More information about the vfio-users mailing list