mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Tejun Heo <tj@kernel.org>, mingo@redhat.com, peterz@infradead.org
Cc: hannes@cmpxchg.org, lizefan@huawei.com, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH v2 1/3] cgroup: define controller file conventions
Date: Wed, 5 Aug 2015 09:39:40 +0900	[thread overview]
Message-ID: <55C15B4C.9080202@jp.fujitsu.com> (raw)
In-Reply-To: <20150804193101.GI17598@mtj.duckdns.org>

On 2015/08/05 4:31, Tejun Heo wrote:
>  From 6abc8ca19df0078de17dc38340db3002ed489ce7 Mon Sep 17 00:00:00 2001
> From: Tejun Heo <tj@kernel.org>
> Date: Tue, 4 Aug 2015 15:20:55 -0400
>
> Traditionally, each cgroup controller implemented whatever interface
> it wanted leading to interfaces which are widely inconsistent.
> Examining the requirements of the controllers readily yield that there
> are only a few control schemes shared among all.
>
> Two major controllers already had to implement new interface for the
> unified hierarchy due to significant structural changes.  Let's take
> the chance to establish common conventions throughout all controllers.
>
> This patch defines CGROUP_WEIGHT_MIN/DFL/MAX to be used on all weight
> based control knobs and documents the conventions that controllers
> should follow on the unified hierarchy.  Except for io.weight knob,
> all existing unified hierarchy knobs are already compliant.  A
> follow-up patch will update io.weight.
>
> v2: Added descriptions of min, low and high knobs.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Li Zefan <lizefan@huawei.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> ---
> Hello,
>
> Added low/high descriptions and applied to the following git branch.
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-4.3-unified-base
>
> The branch currently only contains this patch and will stay stable so
> that it can be pulled from.  I kept the base weight as DFL for now.
> If we decide to change it, I'll apply the change on top.
>
> Thanks.
>
>   Documentation/cgroups/unified-hierarchy.txt | 80 ++++++++++++++++++++++++++---
>   include/linux/cgroup.h                      |  9 ++++
>   2 files changed, 81 insertions(+), 8 deletions(-)
>
> diff --git a/Documentation/cgroups/unified-hierarchy.txt b/Documentation/cgroups/unified-hierarchy.txt
> index 86847a7..1ee9caf 100644
> --- a/Documentation/cgroups/unified-hierarchy.txt
> +++ b/Documentation/cgroups/unified-hierarchy.txt
> @@ -23,10 +23,13 @@ CONTENTS
>   5. Other Changes
>     5-1. [Un]populated Notification
>     5-2. Other Core Changes
> -  5-3. Per-Controller Changes
> -    5-3-1. blkio
> -    5-3-2. cpuset
> -    5-3-3. memory
> +  5-3. Controller File Conventions
> +    5-3-1. Format
> +    5-3-2. Control Knobs
> +  5-4. Per-Controller Changes
> +    5-4-1. blkio
> +    5-4-2. cpuset
> +    5-4-3. memory
>   6. Planned Changes
>     6-1. CAP for resource control
>
> @@ -372,14 +375,75 @@ supported and the interface files "release_agent" and
>   - The "cgroup.clone_children" file is removed.
>
>
> -5-3. Per-Controller Changes
> +5-3. Controller File Conventions
>
> -5-3-1. blkio
> +5-3-1. Format
> +
> +In general, all controller files should be in one of the following
> +formats whenever possible.
> +
> +- Values only files
> +
> +  VAL0 VAL1...\n
> +
> +- Flat keyed files
> +
> +  KEY0 VAL0\n
> +  KEY1 VAL1\n
> +  ...
> +
> +- Nested keyed files
> +
> +  KEY0 SUB_KEY0=VAL00 SUB_KEY1=VAL01...
> +  KEY1 SUB_KEY0=VAL10 SUB_KEY1=VAL11...
> +  ...
> +
> +For a writeable file, the format for writing should generally match
> +reading; however, controllers may allow omitting later fields or
> +implement restricted shortcuts for most common use cases.
> +
> +For both flat and nested keyed files, only the values for a single key
> +can be written at a time.  For nested keyed files, the sub key pairs
> +may be specified in any order and not all pairs have to be specified.
> +
> +
> +5-3-2. Control Knobs
> +
> +- Settings for a single feature should generally be implemented in a
> +  single file.
> +
> +- In general, the root cgroup should be exempt from resource control
> +  and thus shouldn't have resource control knobs.
> +
> +- If a controller implements ratio based resource distribution, the
> +  control knob should be named "weight" and have the range [1, 10000]
> +  and 100 should be the default value.  The values are chosen to allow
> +  enough and symmetric bias in both directions while keeping it
> +  intuitive (the default is 100%).
> +
> +- If a controller implements an absolute resource guarantee and/or
> +  limit, the control knobs should be named "min" and "max"
> +  respectively.  If a controller implements best effort resource
> +  gurantee and/or limit, the control knobs should be named "low" and
> +  "high" respectively.
> +
> +  In the above four control files, the special token "max" should be
> +  used to represent upward infinity for both reading and writing.
> +
so, for memory controller, we'll have

(in alphabet order)
memory.failcnt
memory.force_empty  (<= should this be removed ?)
memory.kmem.failcnt
memory.kmem.max
memory.kmem.max_usage
memory.kmem.slabinfo
memory.kmem.tcp.failcnt
memory.kmem.tcp.max
memory.kmem.tcp.max_usage
memory.kmem.tcp.usage
memory.kmem.usage
memory.max
memory.max_usage
memory.move_charge_at_immigrate
memory.numa_stat
memory.oom_control
memory.pressure_level
memory.high
memory.swapiness
memory.usage
memory.use_hierarchy (<= removed)

?
-Kame


  reply	other threads:[~2015-08-05  0:50 UTC|newest]

Thread overview: 92+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 22:41 [PATCHSET sched,cgroup] sched: Implement interface for cgroup unified hierarchy Tejun Heo
2015-08-03 22:41 ` [PATCH 1/3] cgroup: define controller file conventions Tejun Heo
2015-08-04  8:42   ` Peter Zijlstra
2015-08-04 14:51     ` Tejun Heo
2015-08-04  8:48   ` Peter Zijlstra
2015-08-04 14:53     ` Tejun Heo
2015-08-04 19:31   ` [PATCH v2 " Tejun Heo
2015-08-05  0:39     ` Kamezawa Hiroyuki [this message]
2015-08-05  7:47       ` Michal Hocko
2015-08-06  2:30         ` Kamezawa Hiroyuki
2015-08-07 18:17           ` Michal Hocko
2015-08-17 22:04             ` Johannes Weiner
2015-08-17 21:34     ` Johannes Weiner
2015-08-03 22:41 ` [PATCH 2/3] sched: Misc preps for cgroup unified hierarchy interface Tejun Heo
2015-08-03 22:41 ` [PATCH 3/3] sched: Implement interface for cgroup unified hierarchy Tejun Heo
2015-08-04  9:07   ` Peter Zijlstra
2015-08-04 15:10     ` Tejun Heo
2015-08-05  9:10       ` Peter Zijlstra
2015-08-05 14:31         ` Tejun Heo
2015-08-17 20:35           ` Tejun Heo
     [not found]           ` <CAPM31RJTf0v=2v90kN6-HM9xUGab_k++upO0Ym=irmfO9+BbFw@mail.gmail.com>
2015-08-18  4:03             ` Paul Turner
2015-08-18 20:31               ` Tejun Heo
2015-08-18 23:39                 ` Kamezawa Hiroyuki
2015-08-19 16:23                   ` Tejun Heo
2015-08-19  3:23                 ` Mike Galbraith
2015-08-19 16:41                   ` Tejun Heo
2015-08-20  4:00                     ` Mike Galbraith
2015-08-20  7:52                       ` Tejun Heo
2015-08-20  8:47                         ` Mike Galbraith
2015-08-21 19:26                 ` Paul Turner
2015-08-22 18:29                   ` Tejun Heo
2015-08-24 15:47                     ` Austin S Hemmelgarn
2015-08-24 17:04                       ` Tejun Heo
2015-08-24 19:18                         ` Mike Galbraith
2015-08-24 20:00                         ` Austin S Hemmelgarn
2015-08-24 20:25                           ` Tejun Heo
2015-08-24 21:00                             ` Paul Turner
2015-08-24 21:12                               ` Tejun Heo
2015-08-24 21:15                                 ` Paul Turner
2015-08-24 20:54                         ` Paul Turner
2015-08-24 21:02                           ` Tejun Heo
2015-08-24 21:10                             ` Paul Turner
2015-08-24 21:17                               ` Tejun Heo
2015-08-24 21:19                                 ` Paul Turner
2015-08-24 21:40                                   ` Tejun Heo
2015-08-24 22:03                                     ` Paul Turner
2015-08-24 22:49                                       ` Tejun Heo
2015-08-24 23:15                                         ` Paul Turner
2015-08-25  2:36                                           ` Kamezawa Hiroyuki
2015-08-25 21:13                                             ` Tejun Heo
2015-08-25  9:24                                           ` Ingo Molnar
2015-08-25 10:00                                             ` Peter Zijlstra
2015-08-25 19:18                                           ` Tejun Heo
2015-08-24 20:52                     ` Paul Turner
2015-08-24 21:36                       ` Tejun Heo
2015-08-24 21:58                         ` Paul Turner
2015-08-24 22:19                           ` Tejun Heo
2015-08-24 23:06                             ` Paul Turner
2015-08-25 21:02                               ` Tejun Heo
2015-09-02 17:03                                 ` Tejun Heo
2015-09-09 12:49                                 ` Paul Turner
2015-09-12 14:40                                   ` Tejun Heo
2015-09-17 14:35                                     ` Peter Zijlstra
2015-09-17 14:53                                       ` Tejun Heo
2015-09-17 15:42                                         ` Peter Zijlstra
2015-09-17 15:10                                       ` Peter Zijlstra
2015-09-17 15:52                                         ` Tejun Heo
2015-09-17 15:53                                           ` Peter Zijlstra
2015-09-17 23:29                                     ` Tejun Heo
2015-09-18 11:27                                     ` Paul Turner
2015-10-01 18:46                                       ` Tejun Heo
2015-10-15 11:42                                         ` Paul Turner
2015-10-23 22:21                                           ` Tejun Heo
2015-10-24  4:36                                             ` Mike Galbraith
2015-10-25  2:18                                               ` Tejun Heo
2015-10-25  3:43                                                 ` Mike Galbraith
2015-10-27  3:16                                                   ` Tejun Heo
2015-10-27  5:42                                                     ` Mike Galbraith
2015-10-27  5:46                                                       ` Tejun Heo
2015-10-27  5:56                                                         ` Mike Galbraith
2015-10-27  6:00                                                           ` Tejun Heo
2015-10-27  6:08                                                             ` Mike Galbraith
2015-10-25  3:54                                                 ` Linus Torvalds
2015-10-25  9:33                                                   ` Ingo Molnar
2015-10-25 10:41                                                     ` Theodore Ts'o
2015-10-25 10:47                                                       ` Florian Weimer
2015-10-25 11:58                                                         ` Theodore Ts'o
2015-10-25 13:17                                                           ` Florian Weimer
2015-10-25 13:40                                                             ` Getrandom wrapper Theodore Ts'o
2015-10-26 13:32                                                               ` Florian Weimer
2015-10-26 14:10                                                             ` [PATCH 3/3] sched: Implement interface for cgroup unified hierarchy Peter Zijlstra
2015-08-04 19:32   ` [PATCH v2 " Tejun Heo

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=55C15B4C.9080202@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tj@kernel.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

Powered by JetHome