public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: Waiman Long <longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
	Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
	Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Ingo Molnar <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kernel-team-b10kYP2dOMg@public.gmane.org,
	pjt-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org,
	efault-Mmb7MZpHnFY@public.gmane.org,
	torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org
Subject: Re: [RFC PATCH-cgroup 2/6] cgroup: Enable bypass mode in cgroup v2
Date: Thu, 22 Jun 2017 16:07:10 -0400	[thread overview]
Message-ID: <96422b73-9cda-aebc-5a58-7b8be0eba7c4@redhat.com> (raw)
In-Reply-To: <20170621211701.GB14720-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>

On 06/21/2017 05:17 PM, Tejun Heo wrote:
> Hello, Waiman.
>
> Let's first talk about and make sense of high level semantics.
>
> On Wed, Jun 14, 2017 at 11:05:33AM -0400, Waiman Long wrote:
>> +In the example below, '+' corresponds to an enabled controller and
>> +corresponds to a bypassed controller.
>> +
>> +   +   #   #   #   +
>> +   A - B - C - D - E
>> +         \ F
>> +	   +
>> +In this case, the effective hiearchy is:
>> +
>> +	A|B|C|D - E
>> +	        \ F
> I think that this definitely has potential.  While different
> controllers may see differently abbreviated versions of the tree, they
> can still be mapped to the same hierarchy and we can implement
> cross-controller operations in a meaningful way, I think; however, it
> does make some things really weird.
>
> In the above example, how would A's resources be distributed.  Let's
> say the resource knob in question is memory.high.  Because from memory
> controller's point of view A|B|C|D are all bunched up and have E and F
> as children, memory.high resource knobs on E and F would control how
> A's memory gets distributed, right?

That is right.

> So, once a parent skips a controller with #, you can only determine
> how its resources are actually distributed by scanning the entire
> subtree to determine the span of '#' on the controller and any sort of
> delegation - whether implicit or explicit - wouldn't be possible in
> the middle, right?

That is right, too.

> Can you please think of / explain how this would work with delegation?
> Making things clear with delegation is really helpful because it can
> serve as the canary for the usual hierarchical operations.

+   #   +
A - B - C
        \ D +

In term of delegation story, I would say that for the above
configuration, the parent A can delegate 5 units of resources to B. B,
upon finding out it has 5 units of resources, may decide to take itself
out of the picture (bypass itself) and delegate, say, 2 units to C and 3
units to D assuming that B has no internal process.

Of course, B can decide to ignore the rules, bypass itself and add
internal process to compete with other children of A. So we can make
"cgroup.controllers" non-writable to B if we don't want any controllers
to be bypassed.

As a side note, I have another delegation story for enabling bypass mode
in subtree_control. A parent can activate a controller in bypass mode to
signal that it has delegated the authority to enable a controller to its
children. A child can then activate a controller by writing '+' to its
cgroup.controllers (not implemented yet). In this scenario, the child
own the control knobs, not the parent. That can be useful for
controllers that deal with ID or membership like devices, freezer,
perf_event or even cpusets. You may not want to have separate IDs for
all the nodes in the hierarchy, but for those who need a different ID,
they can choose to do that. In fact, I am thinking if it may be useful
to define a bypass_on_dfl attribute that work like implicit_on_dfl so
that we don't need to explicitly set those controllers in bypass mode.

Cheers,
Longman





  parent reply	other threads:[~2017-06-22 20:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 15:05 [RFC PATCH-cgroup 0/6] cgroup: bypass and subtree root modes Waiman Long
2017-06-14 15:05 ` [RFC PATCH-cgroup 1/6] cgroup: Relax the no internal process constraint Waiman Long
     [not found]   ` <1497452737-11125-2-git-send-email-longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-06-21 20:40     ` Tejun Heo
2017-06-21 21:37       ` Waiman Long
     [not found]         ` <0c752151-f4aa-cda0-ba36-77cdc7dc25c6-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-06-21 21:39           ` Tejun Heo
     [not found]             ` <20170621213905.GD14720-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2017-06-21 21:50               ` Waiman Long
2017-06-21 22:02                 ` Tejun Heo
2017-06-14 15:05 ` [RFC PATCH-cgroup 2/6] cgroup: Enable bypass mode in cgroup v2 Waiman Long
     [not found]   ` <1497452737-11125-3-git-send-email-longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-06-21 21:17     ` Tejun Heo
     [not found]       ` <20170621211701.GB14720-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2017-06-22 20:07         ` Waiman Long [this message]
2017-06-14 15:05 ` [RFC PATCH-cgroup 3/6] cgroup: Allow bypss mode in subtree_control Waiman Long
2017-06-14 15:05 ` [RFC PATCH-cgroup 4/6] cgroup: Introduce subtree root mode Waiman Long
     [not found]   ` <1497452737-11125-5-git-send-email-longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-06-21 21:38     ` Tejun Heo
     [not found]       ` <20170621213807.GC14720-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2017-06-22 20:27         ` Waiman Long
2017-06-14 15:05 ` [RFC PATCH-cgroup 5/6] cgroup: Skip dying css in cgroup_apply_control_{enable,disable} Waiman Long
2017-06-21 21:42   ` Tejun Heo
2017-06-21 22:01     ` Waiman Long
     [not found]       ` <81c62822-8bb6-ae68-112a-dad49414e3f1-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-06-21 22:04         ` Tejun Heo
     [not found]           ` <20170621220438.GB18600-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2017-06-21 22:19             ` Waiman Long
2017-06-14 15:05 ` [RFC PATCH-cgroup 6/6] cgroup: Make debug controller display bypass and subtree root modes info Waiman Long

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=96422b73-9cda-aebc-5a58-7b8be0eba7c4@redhat.com \
    --to=longman-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=efault-Mmb7MZpHnFY@public.gmane.org \
    --cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
    --cc=kernel-team-b10kYP2dOMg@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org \
    --cc=mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=pjt-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox