<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Sep 6, 2015 at 7:19 PM, Garrett Powell <span dir="ltr"><<a href="mailto:garretttracypowell@gmail.com" target="_blank">garretttracypowell@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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 <i>cgcreate</i>, <i>cgset </i>and<i> cgexec</i> lines. Here's my launch script:<br><br><div><div>#!/bin/bash</div><div><br></div><div>export QEMU_AUDIO_DRV=pa</div><div>export QEMU_PA_SERVER=localhost</div><div>export PULSE_SERVER=localhost</div><div><br></div><div>vfio-bind 0000:06:00.0</div><div><br></div><div>synergys --daemon --config /etc/synergy.conf</div><div><br></div><div>for i in {0..3}; do</div><div>    echo performance > /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_governor</div><div>done</div><div><br></div><div>echo 5120 > /proc/sys/vm/nr_hugepages</div><div><br></div><div>cgcreate -g cpuset:kvm</div><div>cgset -r cpuset.cpus=0-3 -r cpuset.mems=0 -r cpuset.cpu_exclusive=1 kvm</div><div>cgexec -g cpuset:kvm qemu-system-x86_64 \</div></div></div></blockquote><div><br></div><div>Ok, so you've change to pCPUs 0-3 instead of 4-7, but doesn't this have the same problem as your previous attempt with taskset?  You're using a different tool, but afaict you're still not doing 1:1 pinning of vCPUs, you're pining them to a set of pCPUs.  Taskset can work, but you need to get the thread ID for each vCPU thread and pin it.  The problem is not the tool you're using but how you're using it, to set the entire process and all the threads it will launch to a range of CPUs rather than pulling out the vCPU threads and individually pinning them.  There's this really great tool that already does this, it's called libvirt.  Thanks,</div><div><br></div><div>Alex <br></div></div></div></div>