<div dir="ltr"><div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 5, 2018 at 4:25 PM Ján Tomko <<a href="mailto:jtomko@redhat.com" target="_blank">jtomko@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Sep 05, 2018 at 03:48:45PM +0300, Nikos Anastopoulos wrote:<br>
>Hello,<br>
><br>
>According to the docs, vcpupin will use either cgroups or sched_setaffinity<br>
>to pin vcpu threads to cpus. How is this decision made?<br>
>I observe differences even on different hosts featuring the same version of<br>
>libvirtd (1.3.1): on one host vcpupin affects cpuset.cpus (cgroup), and on<br>
>the other it affects vcpu threads affinity (observed through taskset).<br>
<br>
It affects both affinity and cpuset.cpus.<br>
<br>
Are there any differences in the host environment, or the domain XML?<br>
<br>
Also note that libvirt 1.3.1 is 2.5 years old now.<br>
<br>
Jano<br></blockquote><div><br></div><div>Hi Jano, </div><div><br></div><div>The domain XMLs are the same. </div><div><br></div><div>"host1" is an Ubuntu 16.04.4 LTS with a 4.4.0-130-generic kernel. In this host vcpupin affects cpuset.cpus. </div><div>As an observation, note that any change in cpuset.cpus gets reflected in task affinity, as well. This is a general behavior, not because of Libvirt and the way that vcpupin works. The opposite is not true, i.e. changing cpu affinity via sched_setaffinity will leave cpuset.cpus intact -- and will fail if you try to specify a cpu not belonging to cpuset.cpus.  <br></div><div><br></div><div>"host2" is also an Ubuntu 16.04.4 LTS with 4.4.0-87-generic. In that host vcpupin affects only task affinities. </div><div><br></div><div>Nikos</div></div></div></div></div>