diff options
Diffstat (limited to 'Documentation/cgroups/cgroups.txt')
-rw-r--r-- | Documentation/cgroups/cgroups.txt | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index 6eb1a97e88ce..455d4e6d346d 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt | |||
@@ -408,6 +408,26 @@ You can attach the current shell task by echoing 0: | |||
408 | 408 | ||
409 | # echo 0 > tasks | 409 | # echo 0 > tasks |
410 | 410 | ||
411 | 2.3 Mounting hierarchies by name | ||
412 | -------------------------------- | ||
413 | |||
414 | Passing the name=<x> option when mounting a cgroups hierarchy | ||
415 | associates the given name with the hierarchy. This can be used when | ||
416 | mounting a pre-existing hierarchy, in order to refer to it by name | ||
417 | rather than by its set of active subsystems. Each hierarchy is either | ||
418 | nameless, or has a unique name. | ||
419 | |||
420 | The name should match [\w.-]+ | ||
421 | |||
422 | When passing a name=<x> option for a new hierarchy, you need to | ||
423 | specify subsystems manually; the legacy behaviour of mounting all | ||
424 | subsystems when none are explicitly specified is not supported when | ||
425 | you give a subsystem a name. | ||
426 | |||
427 | The name of the subsystem appears as part of the hierarchy description | ||
428 | in /proc/mounts and /proc/<pid>/cgroups. | ||
429 | |||
430 | |||
411 | 3. Kernel API | 431 | 3. Kernel API |
412 | ============= | 432 | ============= |
413 | 433 | ||
@@ -501,7 +521,7 @@ rmdir() will fail with it. From this behavior, pre_destroy() can be | |||
501 | called multiple times against a cgroup. | 521 | called multiple times against a cgroup. |
502 | 522 | ||
503 | int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 523 | int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, |
504 | struct task_struct *task) | 524 | struct task_struct *task, bool threadgroup) |
505 | (cgroup_mutex held by caller) | 525 | (cgroup_mutex held by caller) |
506 | 526 | ||
507 | Called prior to moving a task into a cgroup; if the subsystem | 527 | Called prior to moving a task into a cgroup; if the subsystem |
@@ -509,14 +529,20 @@ returns an error, this will abort the attach operation. If a NULL | |||
509 | task is passed, then a successful result indicates that *any* | 529 | task is passed, then a successful result indicates that *any* |
510 | unspecified task can be moved into the cgroup. Note that this isn't | 530 | 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 | 531 | called on a fork. If this method returns 0 (success) then this should |
512 | remain valid while the caller holds cgroup_mutex. | 532 | remain valid while the caller holds cgroup_mutex. If threadgroup is |
533 | true, then a successful result indicates that all threads in the given | ||
534 | thread's threadgroup can be moved together. | ||
513 | 535 | ||
514 | void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 536 | void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, |
515 | struct cgroup *old_cgrp, struct task_struct *task) | 537 | struct cgroup *old_cgrp, struct task_struct *task, |
538 | bool threadgroup) | ||
516 | (cgroup_mutex held by caller) | 539 | (cgroup_mutex held by caller) |
517 | 540 | ||
518 | Called after the task has been attached to the cgroup, to allow any | 541 | Called after the task has been attached to the cgroup, to allow any |
519 | post-attachment activity that requires memory allocations or blocking. | 542 | post-attachment activity that requires memory allocations or blocking. |
543 | If threadgroup is true, the subsystem should take care of all threads | ||
544 | in the specified thread's threadgroup. Currently does not support any | ||
545 | subsystem that might need the old_cgrp for every thread in the group. | ||
520 | 546 | ||
521 | void fork(struct cgroup_subsy *ss, struct task_struct *task) | 547 | void fork(struct cgroup_subsy *ss, struct task_struct *task) |
522 | 548 | ||