Skip to content

Generic Process Containers

[email protected] lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6Generic container system abstracted from cpusets codeDocumentation/containers.txt fs/proc/base.c include/linux/container.h +7 more+1697 -10 replies
2/6Cpusets hooked into containersDocumentation/cpusets.txt fs/super.c include/linux/container.h +9 more+317 -12675 replies
3/6Add generic multi-subsystem API to containersDocumentation/containers.txt include/linux/container.h include/linux/cpuset.h +2 more+427 -880 replies
4/6Simple CPU accounting container subsysteminclude/linux/cpu_acct.h init/Kconfig kernel/Makefile +2 more+138 -00 replies
5/6Extension to container system to allow fork/exit callbacksDocumentation/containers.txt include/linux/container.h kernel/container.c+116 -90 replies
6/6Resource Groups over generic containersinclude/linux/moduleparam.h include/linux/numtasks.h include/linux/res_group.h +10 more+1437 -40 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/6] Generic Process Containers

--

This is an update to my generic containers patch, with the following changes:

- ported to 2.6.19-rc2
- CONFIG_CPUSETS_LEGACY_API option maintains the existing cpusets userspace API
- support for fork/exit callbacks

Patch 6 contains a port of the interesting bits of ResGroups to run over generic containers, along with the example ResGroups numtasks patch. It's not intended to be actually applied with this patch set, but is an example of how other in-kernel systems might use generic containers.

(This time built with multiple compilers and architectures)

-------------------------------------

There have recently been various proposals floating around for resource management/accounting subsystems in the kernel, including Res Groups, User BeanCounters 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, 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.

It also provides a very simple additional container subsystem to do per-container CPU usage accounting; this is primarily to demonstrate use of the container subsystem API, but is useful in its own right.

The change is implemented in five stages:

1) extract the process grouping code from cpusets into a standalone system

2) remove the process grouping code from cpusets and hook into the container system

3) convert the container system to present a generic API, and make cpusets a client of that API

4) add a simple CPU accounting container subsystem as an example

5) add support for fork/exit callbacks iff some subsystem is interested in them

The intention is that the various resource management 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 UBC memory controller

- 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

Possible TODOs include:

- define a convention for populating the per-container directories so that different subsystems don't clash with one another

- provide higher-level primitives (e.g. an easy interface to seq_file) for files registered by subsystems, or potentially convert to use configfs

--