Re: [RFC PATCH-cgroup 1/6] cgroup: Relax the no internal process constraint
From: Tejun Heo
Date: Wed Jun 21 2017 - 16:40:58 EST
Hello, Waiman.
On Wed, Jun 14, 2017 at 11:05:32AM -0400, Waiman Long wrote:
> 2-4-3. No Internal Process Constraint
>
> +When a non-root cgroup distributes resources to their children while
> +having processes of its own, its internal processes will then compete
> +against its children in term of resource allocation. For some resource
> +types, that is not a problem and the controllers are able to handle
> +them correctly. For others, the controllers may not be able to handle
> +internal process competition correctly. This type of controllers are
> +called resource domain controllers in this document.
> +
> +Internal processes are not allowed on non-root cgroups which has
> +any one of those resource domain controllers enabled. Currently all
> +controllers that are allowed in a threaded cgroup will be considered
> +as a non-resource domain controller and hence will not block internal
> +processes. In other words, only cgroups which don't contain any
This isn't on this patch but I'm not sure this is a good way to define
resource domain controllers. We probably should first define resource
domains and walk our way in to the accompanying restrictions and then
the distinction between the controller types.
...
> +Note that the restriction doesn't get in the way if there is no resource
> +domain controller enabled in the cgroup's "cgroup.subtree_control".
> +This is important as otherwise it wouldn't be possible to create
> +children of a populated cgroup. To control resource distribution
> +of a cgroup, the cgroup must create children and transfer all
> +its processes to the children before enabling controllers in its
> +"cgroup.subtree_control" file.
What happens when we add domain handling to CPU so that it is both a
domain and resource controller? Even if that somehow can be resolved,
wouldn't that come with a rather surprising userland behavior changes?
Also, I'm not sure what we're achieving by doing this. It doesn't
really relax the restriction. It just turns it off implicitly when
certain conditions are met, which doesn't really allow any real
capabilities and at least to me the behaviors feel more subtle and
complicated than before.
Thanks.
--
tejun