[Libct] Regarding Libct: Cgroup API
Monali Porob
Monali.Porob at huawei.com
Tue Dec 16 15:08:48 PST 2014
Hi Andrew ,
Thanks for your reply.
Attached is the patch for the below change .
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.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cgroups.patch
Type: application/octet-stream
Size: 522 bytes
Desc: cgroups.patch
URL: <http://lists.openvz.org/pipermail/libct/attachments/20141216/ae662cbf/attachment.obj>
More information about the Libct
mailing list