Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1649835

Re: [RFC PATCH v2 13/17] cgroup: Allow fine-grained controllers control in cgroup v2

From Waiman Long <longman@redhat.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH v2 13/17] cgroup: Allow fine-grained controllers control in cgroup v2
Date 2017-05-24 19:50 +0200
Message-ID <tKIA3-5m6-47@gated-at.bofh.it> (permalink)
References <tHoo9-lZ-3@gated-at.bofh.it> <tHooa-lZ-31@gated-at.bofh.it> <tIXaa-7Bx-21@gated-at.bofh.it> <tIXDb-823-11@gated-at.bofh.it> <tKIqm-5iH-13@gated-at.bofh.it>
Organization Red Hat

Show all headers | View raw


On 05/24/2017 01:31 PM, Tejun Heo wrote:
> Hello, Waiman.
>
> On Fri, May 19, 2017 at 05:20:01PM -0400, Waiman Long wrote:
>>> This breaks the invariant that in a cgroup its resource control knobs
>>> control distribution of resources from its parent.  IOW, the resource
>>> control knobs of a cgroup always belong to the parent.  This is also
>>> reflected in how delegation is done.  The delegatee assumes ownership
>>> of the cgroup itself and the ability to manage sub-cgroups but doesn't
>>> get the ownership of the resource control knobs as otherwise the
>>> parent would lose control over how it distributes its resources.
>> One twist that I am thinking is to have a controller enabled by the
>> parent in subtree_control, but then allow the child to either disable it
>> or set it in pass-through mode by writing to controllers file. IOW, a
>> child cannot enable a controller without parent's permission. Once a
>> child has permission, it can do whatever it wants. A parent cannot force
>> a child to have a controller enabled.
> Heh, I think I need more details to follow your proposal.  Anyways,
> what we need to guarantee is that a descendant is never allowed to
> pull in more resources than its ancestors want it to.

What I am saying is as follows:
    / A
P - B
   \ C

# echo +memory > P/cgroups.subtree_control
# echo -memory > P/A/cgroup.controllers
# echo "#memory" > P/B/cgroup.controllers

The parent grants the memory controller to its children - A, B and C.
Child A has the memory controller explicitly disabled. Child B has the
memory controller in pass-through mode, while child C has the memory
controller enabled by default. "echo +memory > cgroup.controllers" is
not allowed. There are 2 possible choices with regard to the '-' or '#'
prefixes. We can allow them before the grant from the parent or only
after that. In the former case, the state remains dormant until after
the grant from the parent.

Cheers,
Longman

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH v2 13/17] cgroup: Allow fine-grained controllers control in cgroup v2 Waiman Long <longman@redhat.com> - 2017-05-15 15:40 +0200
  Re: [RFC PATCH v2 13/17] cgroup: Allow fine-grained controllers  control in cgroup v2 Tejun Heo <tj@kernel.org> - 2017-05-19 23:00 +0200
    Re: [RFC PATCH v2 13/17] cgroup: Allow fine-grained controllers  control in cgroup v2 Waiman Long <longman@redhat.com> - 2017-05-19 23:30 +0200
      Re: [RFC PATCH v2 13/17] cgroup: Allow fine-grained controllers  control in cgroup v2 Tejun Heo <tj@kernel.org> - 2017-05-24 19:40 +0200
        Re: [RFC PATCH v2 13/17] cgroup: Allow fine-grained controllers  control in cgroup v2 Waiman Long <longman@redhat.com> - 2017-05-24 19:50 +0200
          Re: [RFC PATCH v2 13/17] cgroup: Allow fine-grained controllers  control in cgroup v2 Tejun Heo <tj@kernel.org> - 2017-05-24 20:00 +0200
            Re: [RFC PATCH v2 13/17] cgroup: Allow fine-grained controllers  control in cgroup v2 Waiman Long <longman@redhat.com> - 2017-05-24 20:20 +0200

csiph-web