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

From: Andy Lutomirski
Date: Thu Feb 02 2017 - 16:33:38 EST


On Thu, Feb 2, 2017 at 12:06 PM, Tejun Heo <tj@xxxxxxxxxx> wrote:
> Hello,
>
> This patchset implements cgroup v2 thread mode. It is largely based
> on the discussions that we had at the plumbers last year. Here's the
> rough outline.

I like this, but I have some design questions:

>
> * Thread mode is explicitly enabled on a cgroup by writing "enable"
> into "cgroup.threads" file. The cgroup shouldn't have any child
> cgroups or enabled controllers.

Why do you need to manually turn it on? That is, couldn't it be
automatic based on what controllers are enabled?

>
> * Once enabled, arbitrary sub-hierarchy can be created and threads can
> be put anywhere in the subtree by writing TIDs into "cgroup.threads"
> file. Process granularity and no-internal-process constraint don't
> apply in a threaded subtree.

I'm a bit worried that this conflates two different things. There's
thread support, i.e. allowing individual threads to be placed into
cgroups. There's also more flexible sub-hierarchy support, i.e.
relaxing no-internal-process constraints. For the "cpuacct"
controller, for example, both of these make sense. But what if
someone writes a controller (directio, for example, just to make
something up) for which thread granularity makes sense but relaxing
no-internal-process constraints does not?

--Andy