On Wed, Sep 5, 2018 at 4:25 PM Ján Tomko <jtomko(a)redhat.com> wrote:
On Wed, Sep 05, 2018 at 03:48:45PM +0300, Nikos Anastopoulos wrote:
>Hello,
>
>According to the docs, vcpupin will use either cgroups or
sched_setaffinity
>to pin vcpu threads to cpus. How is this decision made?
>I observe differences even on different hosts featuring the same version
of
>libvirtd (1.3.1): on one host vcpupin affects cpuset.cpus (cgroup), and on
>the other it affects vcpu threads affinity (observed through taskset).
It affects both affinity and cpuset.cpus.
Are there any differences in the host environment, or the domain XML?
Also note that libvirt 1.3.1 is 2.5 years old now.
Jano
Hi Jano,
The domain XMLs are the same.
"host1" is an Ubuntu 16.04.4 LTS with a 4.4.0-130-generic kernel. In this
host vcpupin affects cpuset.cpus.
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.
"host2" is also an Ubuntu 16.04.4 LTS with 4.4.0-87-generic. In that host
vcpupin affects only task affinities.
Nikos