[Libct] Regarding Libct: Cgroup API

Andrey Wagin avagin at gmail.com
Tue Dec 16 23:58:57 PST 2014


2014-12-17 2:08 GMT+03:00 Monali Porob <Monali.Porob at huawei.com>:
> Hi Andrew ,
>
> Thanks for your reply.
> Attached is the patch for the below change .

I need a patch with a commit message and your Signed-off-by: line. I
recomend you to use "git format-patch --signoff"

Thanks.

>
> Regards,
> Monali
>
>
> -----Original Message-----
> From: Andrew Vagin [mailto:avagin at parallels.com]
> Sent: Tuesday, December 16, 2014 1:04 PM
> To: Monali Porob
> Cc: libct at openvz.org; Andrey Wagin
> Subject: Re: [Libct] Regarding Libct: Cgroup API
>
> On Sat, Dec 13, 2014 at 12:43:45AM +0000, Monali Porob wrote:
>> Hi ,
>>
>> I was  working on creating container with memory limits sing  Cgroup
>> APIs  in libct .  Attached is the test program .
>>
>>
>>
>> While testing I figured out that the limits were not getting set and I
>> debugged it further to find :
>>
>> In src/cgroups.c  , function cgroups_create() which is called in
>>  local_spawn_cb() when state is yet not set to CT_RUNNING calls
>> local_config_controller()  and that  postpones the cgroup configuration .
>>
>>
>>
>> Hence I changed cgroups_create()  to call  config_controller() instead
>> of
>> local_config_controller()
>>
>> As follows  ret = config_controller(ct, cfg->ctype, cfg->param,
>> cfg->value);
>>
>>
>>
>> With this change, the cgroup limits are getting set correctly for the
>> process which spawns/enters in the container .
>>
>>
>>
>> Qn : Does this change look correct or is there something missing in my
>> test program.
>
> Yes, it looks correct. Could you send a patch to me? Thank you for investigation.
>
>>
>>
>>
>> Also In future, would libct  have an API to support changing cgroup limits
>> while container is running   ?
>
> Yes, it will.
>
>>
>>
>>
>> Thanks and Regards ,
>>
>> Monali.
>>


More information about the Libct mailing list