Re: [PATCHSET for-4.11] cgroup: implement cgroup v2 thread mode

From: Tejun Heo
Date: Fri Feb 03 2017 - 16:00:01 EST


Hello, Peter.

On Fri, Feb 03, 2017 at 09:20:48PM +0100, Peter Zijlstra wrote:
> So my proposal was to do the inverse of what you propose here. Instead
> of marking special 'thread' subtrees, explicitly mark resource domains
> in the tree.
>
> So always allow arbitrary hierarchies and allow threads to be assigned
> to cgroups, as long as they're all in the same resource domain.
>
> Controllers that do not support things, fallback to mapping everything
> to the nearest resource domain.

That sounds counter-intuitive as all controllers can do resource
domains and only a subset of them can do thread mode. Also, thread
subtrees are necessarily a sub-hierarchy of a resource domain. Also,
expanding resource domains from the root after the trees are populated
would make the behaviors surprising as the resource domains that these
subtrees belong to would change dynamically.

In practice, how would this work? To enable memcg, the user has to
first create the subtree and then explicitly have to make that a
domain and then enable memcg? If so, that would be a completely
unnecessary deviation from the current behavior while not achieving
any more functionalities, right? It's just flipping the default value
the other way around and the default wouldn't be supported by many of
the controllers. I can't see how that is a better option.

Thanks.

--
tejun