[libvirt] [PATCH RFC v3 0/6] support cpu bandwidth in libvirt

Wen Congyang wency at cn.fujitsu.com
Tue Jul 19 03:05:49 UTC 2011


At 07/18/2011 09:36 PM, Lee Schermerhorn Write:
> On Mon, 2011-07-18 at 17:34 +0800, Wen Congyang wrote:
>> TODO:
>> 1. We create sub directory for each vcpu in cpu subsystem. So
>>    we should recalculate cpu.shares for each vcpu.
> 
> Is the per vcpu cgroup optional?  I.e., is is possible to set the period
> and quota for the entire domain and let the host scheduler deal with
> it?  
> 
> Caveat:  Domain level CFS shares seems to work well--"work well" here
> means "behaves as I expected" ;-).  I have no experience with the
> period/quota facility and libvirt domains, so maybe it doesn't make

The quota's value means that all tasks in this task group as a whole
will not be allowedto consume more than quota(unit: us) worth of runtime
within a period of period(unit: us).

If per-vcpu thread is active, each vcpu has a thread. If one vcpu consume
quota worth of runtime, the other vcpu will be hunger.

> sense to cap cpu utilization at the domain level.  
> 
> Regards,
> Lee
> 
>>
>> Changelog:
>> v3: fix some small bugs
>>     implement the simple way
>> v2: almost rewrite the patchset to support to control each vcpu's
>>     bandwidth.
>>     Limit quota to [-1, 2^64/1000] at the schemas level. We will
>>     check it at cgroup level.
>>
>> Wen Congyang (6):
>>   Introduce the function virCgroupForVcpu
>>   cgroup: Implement cpu.cfs_period_us and cpu.cfs_quota_us tuning API
>>   Update XML Schema for new entries
>>   qemu: Implement period and quota tunable XML configuration and
>>     parsing
>>   qemu: Implement cfs_period and cfs_quota's modification
>>   doc: Add documentation for new cputune elements period and quota
>>
>>  docs/formatdomain.html.in                       |   19 ++
>>  docs/schemas/domain.rng                         |   26 +++-
>>  src/conf/domain_conf.c                          |   20 ++-
>>  src/conf/domain_conf.h                          |    2 +
>>  src/libvirt_private.syms                        |    5 +
>>  src/qemu/qemu_cgroup.c                          |  127 +++++++++++
>>  src/qemu/qemu_cgroup.h                          |    4 +
>>  src/qemu/qemu_driver.c                          |  259 ++++++++++++++++++++---
>>  src/qemu/qemu_process.c                         |    4 +
>>  src/util/cgroup.c                               |  153 +++++++++++++-
>>  src/util/cgroup.h                               |   11 +
>>  tests/qemuxml2argvdata/qemuxml2argv-cputune.xml |    2 +
>>  12 files changed, 596 insertions(+), 36 deletions(-)
>>
>> --
>> libvir-list mailing list
>> libvir-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/libvir-list
> 
> 
> 
> 




More information about the libvir-list mailing list