aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/cgroups/cgroups.txt
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-10-17 03:58:25 -0400
committerIngo Molnar <mingo@elte.hu>2009-10-17 03:58:25 -0400
commitbb3c3e807140816b5f5fd4840473ee52a916ad4f (patch)
tree9e8a69d266a7df86ca16177eefffab4b4e910753 /Documentation/cgroups/cgroups.txt
parent595c36490deb49381dc51231a3d5e6b66786ed27 (diff)
parent012abeea669ea49636cf952d13298bb68654146a (diff)
Merge commit 'v2.6.32-rc5' into perf/probes
Conflicts: kernel/trace/trace_event_profile.c Merge reason: update to -rc5 and resolve conflict. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'Documentation/cgroups/cgroups.txt')
-rw-r--r--Documentation/cgroups/cgroups.txt43
1 files changed, 38 insertions, 5 deletions
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index 6eb1a97e88ce..0b33bfe7dde9 100644
--- a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -227,7 +227,14 @@ as the path relative to the root of the cgroup file system.
227Each cgroup is represented by a directory in the cgroup file system 227Each cgroup is represented by a directory in the cgroup file system
228containing the following files describing that cgroup: 228containing the following files describing that cgroup:
229 229
230 - tasks: list of tasks (by pid) attached to that cgroup 230 - tasks: list of tasks (by pid) attached to that cgroup. This list
231 is not guaranteed to be sorted. Writing a thread id into this file
232 moves the thread into this cgroup.
233 - cgroup.procs: list of tgids in the cgroup. This list is not
234 guaranteed to be sorted or free of duplicate tgids, and userspace
235 should sort/uniquify the list if this property is required.
236 Writing a tgid into this file moves all threads with that tgid into
237 this cgroup.
231 - notify_on_release flag: run the release agent on exit? 238 - notify_on_release flag: run the release agent on exit?
232 - release_agent: the path to use for release notifications (this file 239 - release_agent: the path to use for release notifications (this file
233 exists in the top cgroup only) 240 exists in the top cgroup only)
@@ -374,7 +381,7 @@ Now you want to do something with this cgroup.
374 381
375In this directory you can find several files: 382In this directory you can find several files:
376# ls 383# ls
377notify_on_release tasks 384cgroup.procs notify_on_release tasks
378(plus whatever files added by the attached subsystems) 385(plus whatever files added by the attached subsystems)
379 386
380Now attach your shell to this cgroup: 387Now attach your shell to this cgroup:
@@ -408,6 +415,26 @@ You can attach the current shell task by echoing 0:
408 415
409# echo 0 > tasks 416# echo 0 > tasks
410 417
4182.3 Mounting hierarchies by name
419--------------------------------
420
421Passing the name=<x> option when mounting a cgroups hierarchy
422associates the given name with the hierarchy. This can be used when
423mounting a pre-existing hierarchy, in order to refer to it by name
424rather than by its set of active subsystems. Each hierarchy is either
425nameless, or has a unique name.
426
427The name should match [\w.-]+
428
429When passing a name=<x> option for a new hierarchy, you need to
430specify subsystems manually; the legacy behaviour of mounting all
431subsystems when none are explicitly specified is not supported when
432you give a subsystem a name.
433
434The name of the subsystem appears as part of the hierarchy description
435in /proc/mounts and /proc/<pid>/cgroups.
436
437
4113. Kernel API 4383. Kernel API
412============= 439=============
413 440
@@ -501,7 +528,7 @@ rmdir() will fail with it. From this behavior, pre_destroy() can be
501called multiple times against a cgroup. 528called multiple times against a cgroup.
502 529
503int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, 530int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
504 struct task_struct *task) 531 struct task_struct *task, bool threadgroup)
505(cgroup_mutex held by caller) 532(cgroup_mutex held by caller)
506 533
507Called prior to moving a task into a cgroup; if the subsystem 534Called prior to moving a task into a cgroup; if the subsystem
@@ -509,14 +536,20 @@ returns an error, this will abort the attach operation. If a NULL
509task is passed, then a successful result indicates that *any* 536task is passed, then a successful result indicates that *any*
510unspecified task can be moved into the cgroup. Note that this isn't 537unspecified task can be moved into the cgroup. Note that this isn't
511called on a fork. If this method returns 0 (success) then this should 538called on a fork. If this method returns 0 (success) then this should
512remain valid while the caller holds cgroup_mutex. 539remain valid while the caller holds cgroup_mutex. If threadgroup is
540true, then a successful result indicates that all threads in the given
541thread's threadgroup can be moved together.
513 542
514void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, 543void attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
515 struct cgroup *old_cgrp, struct task_struct *task) 544 struct cgroup *old_cgrp, struct task_struct *task,
545 bool threadgroup)
516(cgroup_mutex held by caller) 546(cgroup_mutex held by caller)
517 547
518Called after the task has been attached to the cgroup, to allow any 548Called after the task has been attached to the cgroup, to allow any
519post-attachment activity that requires memory allocations or blocking. 549post-attachment activity that requires memory allocations or blocking.
550If threadgroup is true, the subsystem should take care of all threads
551in the specified thread's threadgroup. Currently does not support any
552subsystem that might need the old_cgrp for every thread in the group.
520 553
521void fork(struct cgroup_subsy *ss, struct task_struct *task) 554void fork(struct cgroup_subsy *ss, struct task_struct *task)
522 555