[Devel] [PATCH] cgroups: fix set command with beancounters upstream

Glauber Costa glommer at parallels.com
Tue Apr 30 03:17:49 PDT 2013


On 04/30/2013 01:48 PM, Kir Kolyshkin wrote:
> On 04/29/2013 10:12 PM, Glauber Costa wrote:
>> The kernel memory controller cannot flip states from unlimited to
>> limited if
>> there are already tasks in it.  Therefore, we always have to run with
>> *some*
>> value of kmem enabled. If we don't do it, we can't start unlimited and
>> then use
>> the set command to set any beancounters. We write the maximum amount
>> minus two
>> pages, which should effectively mean "accounting turned on, but
>> unlimited"
> 
> Alternatively, we can require CT restart for the change to take effect.
> We do that for a few options, see check_set_mode().
> 
> But this is probably OK too.

Being all the same to you, I prefer this way. This is not really about
"container running", but rather "cgroups have tasks". Doing it on
restart would still mandate us to always be careful about when to set up
cgroup limits and always do that before we put any tasks into it. Of
course we can do that, but not having that limitation makes us more
robust IMHO. We also already have a lot of non-limit related stuff that
we have to do during creation anyway (like setting up cpusets and memory
hierarchy), so it just fits together nicely




More information about the Devel mailing list