Skip to content

Containers (V9): Generic Process Containers

[email protected] lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 26 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9Containers (V9): Basic container frameworkDocumentation/containers.txt include/linux/container.h include/linux/container_subsys.h +5 more+1923 -19 replies
2/9Containers (V9): Example CPU accounting subsysteminclude/linux/container_subsys.h include/linux/cpu_acct.h init/Kconfig +3 more+224 -31 reply
3/9Containers (V9): Add tasks file interfaceinclude/linux/container.h kernel/container.c+346 -09 replies
4/9Containers (V9): Add fork/exit hooksinclude/linux/container.h kernel/container.c kernel/exit.c +1 more+146 -20 replies
5/9Containers (V9): Add container_clone() interfaceinclude/linux/container.h kernel/container.c+123 -00 replies
6/9Containers (V9): Add procfs interfacefs/proc/base.c kernel/container.c+135 -00 replies
7/9Containers (V9): Make cpusets a client of containersDocumentation/cpusets.txt fs/proc/base.c include/linux/container_subsys.h +8 more+236 -10510 replies
8/9Containers (V9): Share css_group arrays between tasks with same container membershipsinclude/linux/container.h include/linux/sched.h kernel/container.c+238 -750 replies
9/9Containers (V9): Simple debug info subsysteminclude/linux/container_subsys.h init/Kconfig kernel/Makefile +1 more+104 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/9] Containers (V9): Generic Process Containers

--

This is an update to my multi-hierarchy multi-subsystem generic process containers patch. Changes since V8 (April 6th) include:

- The patchset has been rebased over 2.6.21-rc7-mm1

- The patchset has been restructured based on feedback; more functionality is now split out into separate patches where practical.

- The container_group structure has been renamed css_group since this is more descriptive of its true function

- Added a simplified file registration interface, and a simple interface for the common operation of returning a single number to userspace from a container control file

- Added a simple "debug" subsystem that is both an example of how to use the container system and a useful debugging tool for checking reference counts, etc.

Still TODO:

- decide whether "Containers" is an acceptable name for the system given its usage by some other development groups, or whether something else (ProcessSets? ResourceGroups? TaskGroups?) would be better

- decide whether merging css_group and nsproxy is desirable

- add a hash-table based lookup for css_group objects.

- use seq_file properly in container tasks files to avoid having to allocate a big array for all the container's task pointers.

- add back support for the "release agent" functionality

- lots more testing

- define standards for container file names

Generic Process Containers
--------------------------

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 containers, 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.

Already existing in the kernel is the cpuset subsystem; this has a process grouping mechanism that is mature, tested, and well documented (particularly with regards to synchronization rules).

This patchset extracts the process grouping code from cpusets into a generic container system, and makes the cpusets code a client of the container system, along with a couple of simple example subsystems.

The patch set is structured as follows:

1) Basic container framework - filesystem and tracking structures

2) Simple CPU Accounting example subsystem

3) Support for the "tasks" control file

4) Hooks for fork() and exit()

5) Support for the container_clone() operation

6) Add /proc reporting interface

7) Make cpusets a container subsystem

8) Share container subsystem pointer arrays between tasks with the same assignments

9) Simple container debugging subsystem

The intention is that the various resource management and virtualization efforts can also become container clients, with the result that:

- the userspace APIs are (somewhat) normalised

- it's easier to test out 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