[libvirt] [PATCH 00/13] Support hypervisor-threads-pin in vcpupin.

tangchen tangchen at cn.fujitsu.com
Sat Jul 21 02:54:37 UTC 2012


Hi eric,

Would you please take sometime to have a look at these patches ?

Thanks. :)

On 07/10/2012 02:28 PM, tangchen wrote:
> Hi~
> 
> Users can use vcpupin command to bind a vcpu thread to a specific physical cpu.
> But besides vcpu threads, there are alse some other threads created by qemu 
> (known as hypervisor threads) that could not be explicitly bound to physical cpus.
> 
> The first 3 patches are from Wen Congyang, which implement Cgroup for differrent
> hypervisors.
> 
> The other 10 patches implemented hypervisor threads binding, in two ways:
>   1) Use sched_setaffinity() function;
>   2) Use cpuset cgroup.
> 
> 
> A new xml element is introduced, and vcpupin command is improved, see below.
> 
> 1. Introduce new xml elements:
>   <cputune>
>     ......
>     <hypervisorpin cpuset='1'/>
>   </cputune>
> 
> 
> 2. Improve vcpupin command to support hypervisor threads binding.
> 
> For example, vm1 has the following configuration:
>   <cputune>
>     <vcpupin vcpu='1' cpuset='1'/>
>     <vcpupin vcpu='0' cpuset='0'/>
>     <hypervisorpin cpuset='1'/>
>   </cputune>
> 
>   1) query all threads pining
> 
>      # vcpupin vm1
>      VCPU: CPU Affinity
>      ----------------------------------
>         0: 0
>         1: 1
> 
>      Hypervisor: CPU Affinity
>      ----------------------------------
>         *: 1
> 
>   2) query hypervisor threads pining only
> 
>      # vcpupin vm1 --hypervisor
>      Hypervisor: CPU Affinity
>      ----------------------------------
>         *: 1
> 
>   3) change hypervisor threads pining
> 
>      # vcpupin vm1 --hypervisor 0-1
> 
>      # vcpupin vm1 --hypervisor
>      Hypervisor: CPU Affinity
>      ----------------------------------
>         *: 0-1
> 
>      # taskset -p 397
>      pid 397's current affinity mask: 3
> 
> 
> Note: If users want to pin a vcpu thread to pcpu, --vcpu option could no longer be omitted.
> 
> 
> Tang Chen (10):
>   Enable cpuset cgroup and synchronous vcpupin info to cgroup.
>   Support hypervisorpin xml parse.
>   Introduce qemuSetupCgroupHypervisorPin and synchronize hypervisorpin
>     info to cgroup.
>   Add qemuProcessSetHypervisorAffinites and set hypervisor threads
>     affinities
>   Introduce virDomainHypervisorPinAdd and virDomainHypervisorPinDel
>     functions
>   Introduce qemudDomainPinHypervisorFlags and
>     qemudDomainGetHypervisorPinInfo in qemu driver.
>   Introduce remoteDomainPinHypervisorFlags and
>     remoteDomainGetHypervisorPinInfo functions in remote driver.
>   Introduce remoteDispatchDomainPinHypervisorFlags and
>     remoteDispatchDomainGetHypervisorPinInfo functions.
>   Introduce virDomainPinHypervisorFlags and
>     virDomainGetHypervisorPinInfo functions.
>   Improve vcpupin to support hypervisorpin dynically.
> 
> Wen Congyang (3):
>   Introduce the function virCgroupForHypervisor
>   Introduce the function virCgroupMoveTask
>   create a new cgroup and move all hypervisor threads to the new cgroup
> 
>  .gnulib                                         |    2 +-
>  daemon/remote.c                                 |  103 +++++++++
>  docs/schemas/domaincommon.rng                   |    7 +
>  include/libvirt/libvirt.h.in                    |   10 +
>  src/conf/domain_conf.c                          |  173 ++++++++++++++-
>  src/conf/domain_conf.h                          |    7 +
>  src/driver.h                                    |   13 ++
>  src/libvirt.c                                   |  147 +++++++++++++
>  src/libvirt_private.syms                        |    7 +
>  src/libvirt_public.syms                         |    2 +
>  src/qemu/qemu_cgroup.c                          |  147 ++++++++++++-
>  src/qemu/qemu_cgroup.h                          |    5 +
>  src/qemu/qemu_driver.c                          |  261 ++++++++++++++++++++++-
>  src/qemu/qemu_process.c                         |   60 +++++-
>  src/remote/remote_driver.c                      |  102 +++++++++
>  src/remote/remote_protocol.x                    |   23 +-
>  src/remote_protocol-structs                     |   24 +++
>  src/util/cgroup.c                               |  204 +++++++++++++++++-
>  src/util/cgroup.h                               |   15 ++
>  tests/qemuxml2argvdata/qemuxml2argv-cputune.xml |    1 +
>  tests/vcpupin                                   |    6 +-
>  tools/virsh.c                                   |  147 ++++++++-----
>  tools/virsh.pod                                 |   16 +-
>  23 files changed, 1405 insertions(+), 77 deletions(-)
> 

-- 
Best Regards,
Tang chen




More information about the libvir-list mailing list