[libvirt] [PATCH 03/17] create a new cgroup and move all hypervisor threads to the new cgroup

Eric Blake eblake at redhat.com
Mon Aug 6 21:18:07 UTC 2012


On 08/03/2012 12:36 AM, Hu Tao wrote:
> From: Wen Congyang <wency at cn.fujitsu.com>
> 
> Create a new cgroup and move all hypervisor threads to the new cgroup.
> And then we can do the other things:
> 1. limit only vcpu usage rather than the whole qemu
> 2. limit for hypervisor threads(include vhost-net threads)
> 
> Signed-off-by: Wen Congyang <wency at cn.fujitsu.com>
> Signed-off-by: Tang Chen <tangchen at cn.fujitsu.com>
> Signed-off-by: Hu Tao <hutao at cn.fujitsu.com>
> ---

>  
> +int qemuSetupCgroupForHypervisor(struct qemud_driver *driver,
> +                                 virDomainObjPtr vm)
> +{

> +
> +    for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
> +        if (!qemuCgroupControllerActive(driver, i)) {
> +            VIR_WARN("cgroup %d is not active", i);
> +            continue;
> +        }

Do we need to do this for every controller, or only for the cpu and
cpuacct controllers?

Again, looks reasonable in isolation.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120806/1194f4b8/attachment-0001.sig>


More information about the libvir-list mailing list