mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
cgroups: implement namespace tracking subsystem
When a task enters a new namespace via a clone() or unshare(), a new cgroup is created and the task moves into it. This version names cgroups which are automatically created using cgroup_clone() as "node_<pid>" where pid is the pid of the unsharing or cloned process. (Thanks Pavel for the idea) This is safe because if the process unshares again, it will create /cgroups/(...)/node_<pid>/node_<pid> The only possibilities (AFAICT) for a -EEXIST on unshare are 1. pid wraparound 2. a process fails an unshare, then tries again. Case 1 is unlikely enough that I ignore it (at least for now). In case 2, the node_<pid> will be empty and can be rmdir'ed to make the subsequent unshare() succeed. Changelog: Name cloned cgroups as "node_<pid>". [[email protected]: fix order of cgroup subsystems in init/Kconfig] Signed-off-by: Serge E. Hallyn <[email protected]> Cc: Paul Menage <[email protected]> Signed-off-by: Cedric Le Goater <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
846c7bb055
commit
858d72ead4
6 changed files with 146 additions and 8 deletions
23
init/Kconfig
23
init/Kconfig
|
|
@ -288,6 +288,22 @@ config CGROUP_DEBUG
|
|||
|
||||
Say N if unsure
|
||||
|
||||
config CGROUP_NS
|
||||
bool "Namespace cgroup subsystem"
|
||||
depends on CGROUPS
|
||||
help
|
||||
Provides a simple namespace cgroup subsystem to
|
||||
provide hierarchical naming of sets of namespaces,
|
||||
for instance virtual servers and checkpoint/restart
|
||||
jobs.
|
||||
|
||||
config CGROUP_CPUACCT
|
||||
bool "Simple CPU accounting cgroup subsystem"
|
||||
depends on CGROUPS
|
||||
help
|
||||
Provides a simple Resource Controller for monitoring the
|
||||
total CPU consumed by the tasks in a cgroup
|
||||
|
||||
config CPUSETS
|
||||
bool "Cpuset support"
|
||||
depends on SMP && CGROUPS
|
||||
|
|
@ -345,13 +361,6 @@ config PROC_PID_CPUSET
|
|||
depends on CPUSETS
|
||||
default y
|
||||
|
||||
config CGROUP_CPUACCT
|
||||
bool "Simple CPU accounting cgroup subsystem"
|
||||
depends on CGROUPS
|
||||
help
|
||||
Provides a simple Resource Controller for monitoring the
|
||||
total CPU consumed by the tasks in a cgroup
|
||||
|
||||
config RELAY
|
||||
bool "Kernel->user space relay support (formerly relayfs)"
|
||||
help
|
||||
|
|
|
|||
Loading…
Reference in a new issue