diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-10-17 03:58:25 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-17 03:58:25 -0400 |
commit | bb3c3e807140816b5f5fd4840473ee52a916ad4f (patch) | |
tree | 9e8a69d266a7df86ca16177eefffab4b4e910753 /Documentation/cgroups/cgroups.txt | |
parent | 595c36490deb49381dc51231a3d5e6b66786ed27 (diff) | |
parent | 012abeea669ea49636cf952d13298bb68654146a (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.txt | 43 |
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. | |||
227 | Each cgroup is represented by a directory in the cgroup file system | 227 | Each cgroup is represented by a directory in the cgroup file system |
228 | containing the following files describing that cgroup: | 228 | containing 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 | ||
375 | In this directory you can find several files: | 382 | In this directory you can find several files: |
376 | # ls | 383 | # ls |
377 | notify_on_release tasks | 384 | cgroup.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 | ||
380 | Now attach your shell to this cgroup: | 387 | Now 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 | ||
418 | 2.3 Mounting hierarchies by name | ||
419 | -------------------------------- | ||
420 | |||
421 | Passing the name=<x> option when mounting a cgroups hierarchy | ||
422 | associates the given name with the hierarchy. This can be used when | ||
423 | mounting a pre-existing hierarchy, in order to refer to it by name | ||
424 | rather than by its set of active subsystems. Each hierarchy is either | ||
425 | nameless, or has a unique name. | ||
426 | |||
427 | The name should match [\w.-]+ | ||
428 | |||
429 | When passing a name=<x> option for a new hierarchy, you need to | ||
430 | specify subsystems manually; the legacy behaviour of mounting all | ||
431 | subsystems when none are explicitly specified is not supported when | ||
432 | you give a subsystem a name. | ||
433 | |||
434 | The name of the subsystem appears as part of the hierarchy description | ||
435 | in /proc/mounts and /proc/<pid>/cgroups. | ||
436 | |||
437 | |||
411 | 3. Kernel API | 438 | 3. Kernel API |
412 | ============= | 439 | ============= |
413 | 440 | ||
@@ -501,7 +528,7 @@ rmdir() will fail with it. From this behavior, pre_destroy() can be | |||
501 | called multiple times against a cgroup. | 528 | called multiple times against a cgroup. |
502 | 529 | ||
503 | int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 530 | int 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 | ||
507 | Called prior to moving a task into a cgroup; if the subsystem | 534 | Called 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 | |||
509 | task is passed, then a successful result indicates that *any* | 536 | task is passed, then a successful result indicates that *any* |
510 | unspecified task can be moved into the cgroup. Note that this isn't | 537 | unspecified task can be moved into the cgroup. Note that this isn't |
511 | called on a fork. If this method returns 0 (success) then this should | 538 | called on a fork. If this method returns 0 (success) then this should |
512 | remain valid while the caller holds cgroup_mutex. | 539 | remain valid while the caller holds cgroup_mutex. If threadgroup is |
540 | true, then a successful result indicates that all threads in the given | ||
541 | thread's threadgroup can be moved together. | ||
513 | 542 | ||
514 | void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 543 | void 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 | ||
518 | Called after the task has been attached to the cgroup, to allow any | 548 | Called after the task has been attached to the cgroup, to allow any |
519 | post-attachment activity that requires memory allocations or blocking. | 549 | post-attachment activity that requires memory allocations or blocking. |
550 | If threadgroup is true, the subsystem should take care of all threads | ||
551 | in the specified thread's threadgroup. Currently does not support any | ||
552 | subsystem that might need the old_cgrp for every thread in the group. | ||
520 | 553 | ||
521 | void fork(struct cgroup_subsy *ss, struct task_struct *task) | 554 | void fork(struct cgroup_subsy *ss, struct task_struct *task) |
522 | 555 | ||