Re: [PATCH] cpuset: Enforce that a child's cpus must be a subset of the parent

From: Peter Zijlstra
Date: Thu May 31 2018 - 12:17:14 EST


On Thu, May 31, 2018 at 08:58:07AM -0700, Tejun Heo wrote:
> Tying together what's configured and what's applied may feel
> attractive on the surface but it's a long term headache.
>
> * It's inconsistent with what other controllers are doing. All the
> limit resource configs declare the upper bound the specific cgroup
> can consume regardless of what's actually available to it. They
> limit but don't guarantee access.
>
> * Which decouples a given cgroup's configurations from its ancestors',
> which allows an ancestor to take away resources that it granted
> before and then also giving it back later. No matter what you do,
> if you couple configs of cgroup hierarchy, you end up restricting
> what an ancestor can do to its sub-hierarchy, which can quickly
> become a difficult operational headache.
>
> So, let's please stay away from it even if that means a bit of
> overhead in terms of interface.

Urgh, that again :/

I'm still not convinced by your arguments though. The root container can
access all the sub-groups anyway and can grub around in them to take
away resources if it really wants to.

For cpuset in particular randomly restricting on the ancestor level can
create an unrecoverable trainwreck inside a container. Affinities are
not recoverable. Once a runnable task ends up with an empty set, its
affinities are reset and the smaller (empty) set is lost.