[Libct] Regarding Libct: Cgroup API
Andrew Vagin
avagin at parallels.com
Tue Dec 16 13:04:00 PST 2014
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