2013-07-10 07:17:39 +08:00
|
|
|
/*
|
|
|
|
* List of cgroup subsystems.
|
|
|
|
*
|
|
|
|
* DO NOT ADD ANY SUBSYSTEM WITHOUT EXPLICIT ACKS FROM CGROUP MAINTAINERS.
|
Task Control Groups: basic task cgroup framework
Generic Process Control Groups
--------------------------
There have recently been various proposals floating around for
resource management/accounting and other task grouping subsystems in
the kernel, including ResGroups, User BeanCounters, NSProxy
cgroups, and others. These all need the basic abstraction of being
able to group together multiple processes in an aggregate, in order to
track/limit the resources permitted to those processes, or control
other behaviour of the processes, and all implement this grouping in
different ways.
This patchset provides a framework for tracking and grouping processes
into arbitrary "cgroups" and assigning arbitrary state to those
groupings, in order to control the behaviour of the cgroup as an
aggregate.
The intention is that the various resource management and
virtualization/cgroup efforts can also become task cgroup
clients, with the result that:
- the userspace APIs are (somewhat) normalised
- it's easier to test e.g. the ResGroups CPU controller in
conjunction with the BeanCounters memory controller, or use either of
them as the resource-control portion of a virtual server system.
- the additional kernel footprint of any of the competing resource
management systems is substantially reduced, since it doesn't need
to provide process grouping/containment, hence improving their
chances of getting into the kernel
This patch:
Add the main task cgroups framework - the cgroup filesystem, and the
basic structures for tracking membership and associating subsystem state
objects to tasks.
Signed-off-by: Paul Menage <menage@google.com>
Cc: Serge E. Hallyn <serue@us.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Paul Jackson <pj@sgi.com>
Cc: Kirill Korotaev <dev@openvz.org>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Srivatsa Vaddagiri <vatsa@in.ibm.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-19 14:39:30 +08:00
|
|
|
*/
|
2015-06-09 19:32:09 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This file *must* be included with SUBSYS() defined.
|
|
|
|
* SUBSYS_TAG() is a noop if undefined.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SUBSYS_TAG
|
|
|
|
#define __TMP_SUBSYS_TAG
|
|
|
|
#define SUBSYS_TAG(_x)
|
|
|
|
#endif
|
|
|
|
|
2014-02-08 23:36:58 +08:00
|
|
|
#if IS_ENABLED(CONFIG_CPUSETS)
|
2007-10-19 14:39:39 +08:00
|
|
|
SUBSYS(cpuset)
|
|
|
|
#endif
|
|
|
|
|
2014-02-08 23:36:58 +08:00
|
|
|
#if IS_ENABLED(CONFIG_CGROUP_SCHED)
|
2014-02-08 23:36:58 +08:00
|
|
|
SUBSYS(cpu)
|
2007-10-19 14:41:03 +08:00
|
|
|
#endif
|
|
|
|
|
2014-02-08 23:36:58 +08:00
|
|
|
#if IS_ENABLED(CONFIG_CGROUP_CPUACCT)
|
2007-12-03 03:04:49 +08:00
|
|
|
SUBSYS(cpuacct)
|
|
|
|
#endif
|
|
|
|
|
2015-01-07 01:02:46 +08:00
|
|
|
#if IS_ENABLED(CONFIG_BLK_CGROUP)
|
blkcg: rename subsystem name from blkio to io
blkio interface has become messy over time and is currently the
largest. In addition to the inconsistent naming scheme, it has
multiple stat files which report more or less the same thing, a number
of debug stat files which expose internal details which shouldn't have
been part of the public interface in the first place, recursive and
non-recursive stats and leaf and non-leaf knobs.
Both recursive vs. non-recursive and leaf vs. non-leaf distinctions
don't make any sense on the unified hierarchy as only leaf cgroups can
contain processes. cgroups is going through a major interface
revision with the unified hierarchy involving significant fundamental
usage changes and given that a significant portion of the interface
doesn't make sense anymore, it's a good time to reorganize the
interface.
As the first step, this patch renames the external visible subsystem
name from "blkio" to "io". This is more concise, matches the other
two major subsystem names, "cpu" and "memory", and better suited as
blkcg will be involved in anything writeback related too whether an
actual block device is involved or not.
As the subsystem legacy_name is set to "blkio", the only userland
visible change outside the unified hierarchy is that blkcg is reported
as "io" instead of "blkio" in the subsystem initialized message during
boot. On the unified hierarchy, blkcg now appears as "io".
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: cgroups@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@fb.com>
2015-08-19 05:55:29 +08:00
|
|
|
SUBSYS(io)
|
2015-01-07 01:02:46 +08:00
|
|
|
#endif
|
|
|
|
|
2014-02-08 23:36:58 +08:00
|
|
|
#if IS_ENABLED(CONFIG_MEMCG)
|
2014-02-08 23:36:58 +08:00
|
|
|
SUBSYS(memory)
|
2008-02-07 16:13:50 +08:00
|
|
|
#endif
|
|
|
|
|
2014-02-08 23:36:58 +08:00
|
|
|
#if IS_ENABLED(CONFIG_CGROUP_DEVICE)
|
2008-04-29 16:00:10 +08:00
|
|
|
SUBSYS(devices)
|
|
|
|
#endif
|
|
|
|
|
2014-02-08 23:36:58 +08:00
|
|
|
#if IS_ENABLED(CONFIG_CGROUP_FREEZER)
|
2008-10-19 11:27:21 +08:00
|
|
|
SUBSYS(freezer)
|
|
|
|
#endif
|
|
|
|
|
2014-02-08 23:36:58 +08:00
|
|
|
#if IS_ENABLED(CONFIG_CGROUP_NET_CLASSID)
|
2008-11-08 14:56:00 +08:00
|
|
|
SUBSYS(net_cls)
|
|
|
|
#endif
|
|
|
|
|
2014-02-08 23:36:58 +08:00
|
|
|
#if IS_ENABLED(CONFIG_CGROUP_PERF)
|
2014-02-08 23:36:58 +08:00
|
|
|
SUBSYS(perf_event)
|
2011-02-14 17:20:01 +08:00
|
|
|
#endif
|
|
|
|
|
2014-02-08 23:36:58 +08:00
|
|
|
#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
|
2011-11-22 13:10:51 +08:00
|
|
|
SUBSYS(net_prio)
|
|
|
|
#endif
|
|
|
|
|
2014-02-08 23:36:58 +08:00
|
|
|
#if IS_ENABLED(CONFIG_CGROUP_HUGETLB)
|
2012-08-01 07:42:12 +08:00
|
|
|
SUBSYS(hugetlb)
|
|
|
|
#endif
|
2014-05-15 07:33:07 +08:00
|
|
|
|
2015-06-09 19:32:09 +08:00
|
|
|
/*
|
|
|
|
* Subsystems that implement the can_fork() family of callbacks.
|
|
|
|
*/
|
|
|
|
SUBSYS_TAG(CANFORK_START)
|
2015-06-09 19:32:10 +08:00
|
|
|
|
|
|
|
#if IS_ENABLED(CONFIG_CGROUP_PIDS)
|
|
|
|
SUBSYS(pids)
|
|
|
|
#endif
|
|
|
|
|
2015-06-09 19:32:09 +08:00
|
|
|
SUBSYS_TAG(CANFORK_END)
|
|
|
|
|
2014-05-15 07:33:07 +08:00
|
|
|
/*
|
|
|
|
* The following subsystems are not supported on the default hierarchy.
|
|
|
|
*/
|
|
|
|
#if IS_ENABLED(CONFIG_CGROUP_DEBUG)
|
|
|
|
SUBSYS(debug)
|
|
|
|
#endif
|
2015-06-09 19:32:09 +08:00
|
|
|
|
|
|
|
#ifdef __TMP_SUBSYS_TAG
|
|
|
|
#undef __TMP_SUBSYS_TAG
|
|
|
|
#undef SUBSYS_TAG
|
|
|
|
#endif
|
|
|
|
|
2013-07-10 07:17:39 +08:00
|
|
|
/*
|
|
|
|
* DO NOT ADD ANY SUBSYSTEM WITHOUT EXPLICIT ACKS FROM CGROUP MAINTAINERS.
|
|
|
|
*/
|