diff options
| -rw-r--r-- | Documentation/cgroups/cgroups.txt | 26 | ||||
| -rw-r--r-- | block/blk-cgroup.c | 22 | ||||
| -rw-r--r-- | include/linux/cgroup.h | 29 | ||||
| -rw-r--r-- | include/net/sock.h | 7 | ||||
| -rw-r--r-- | include/net/tcp_memcontrol.h | 2 | ||||
| -rw-r--r-- | kernel/cgroup.c | 43 | ||||
| -rw-r--r-- | kernel/cgroup_freezer.c | 11 | ||||
| -rw-r--r-- | kernel/cpuset.c | 16 | ||||
| -rw-r--r-- | kernel/events/core.c | 13 | ||||
| -rw-r--r-- | kernel/sched/core.c | 20 | ||||
| -rw-r--r-- | mm/memcontrol.c | 48 | ||||
| -rw-r--r-- | net/core/netprio_cgroup.c | 10 | ||||
| -rw-r--r-- | net/core/sock.c | 6 | ||||
| -rw-r--r-- | net/ipv4/tcp_memcontrol.c | 2 | ||||
| -rw-r--r-- | net/sched/cls_cgroup.c | 10 | ||||
| -rw-r--r-- | security/device_cgroup.c | 10 |
16 files changed, 113 insertions, 162 deletions
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index a7c96ae5557c..8e74980ab385 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt | |||
| @@ -558,8 +558,7 @@ Each subsystem may export the following methods. The only mandatory | |||
| 558 | methods are create/destroy. Any others that are null are presumed to | 558 | methods are create/destroy. Any others that are null are presumed to |
| 559 | be successful no-ops. | 559 | be successful no-ops. |
| 560 | 560 | ||
| 561 | struct cgroup_subsys_state *create(struct cgroup_subsys *ss, | 561 | struct cgroup_subsys_state *create(struct cgroup *cgrp) |
| 562 | struct cgroup *cgrp) | ||
| 563 | (cgroup_mutex held by caller) | 562 | (cgroup_mutex held by caller) |
| 564 | 563 | ||
| 565 | Called to create a subsystem state object for a cgroup. The | 564 | Called to create a subsystem state object for a cgroup. The |
| @@ -574,7 +573,7 @@ identified by the passed cgroup object having a NULL parent (since | |||
| 574 | it's the root of the hierarchy) and may be an appropriate place for | 573 | it's the root of the hierarchy) and may be an appropriate place for |
| 575 | initialization code. | 574 | initialization code. |
| 576 | 575 | ||
| 577 | void destroy(struct cgroup_subsys *ss, struct cgroup *cgrp) | 576 | void destroy(struct cgroup *cgrp) |
| 578 | (cgroup_mutex held by caller) | 577 | (cgroup_mutex held by caller) |
| 579 | 578 | ||
| 580 | The cgroup system is about to destroy the passed cgroup; the subsystem | 579 | The cgroup system is about to destroy the passed cgroup; the subsystem |
| @@ -585,7 +584,7 @@ cgroup->parent is still valid. (Note - can also be called for a | |||
| 585 | newly-created cgroup if an error occurs after this subsystem's | 584 | newly-created cgroup if an error occurs after this subsystem's |
| 586 | create() method has been called for the new cgroup). | 585 | create() method has been called for the new cgroup). |
| 587 | 586 | ||
| 588 | int pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp); | 587 | int pre_destroy(struct cgroup *cgrp); |
| 589 | 588 | ||
| 590 | Called before checking the reference count on each subsystem. This may | 589 | Called before checking the reference count on each subsystem. This may |
| 591 | be useful for subsystems which have some extra references even if | 590 | be useful for subsystems which have some extra references even if |
| @@ -593,8 +592,7 @@ there are not tasks in the cgroup. If pre_destroy() returns error code, | |||
| 593 | rmdir() will fail with it. From this behavior, pre_destroy() can be | 592 | rmdir() will fail with it. From this behavior, pre_destroy() can be |
| 594 | called multiple times against a cgroup. | 593 | called multiple times against a cgroup. |
| 595 | 594 | ||
| 596 | int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 595 | int can_attach(struct cgroup *cgrp, struct cgroup_taskset *tset) |
| 597 | struct cgroup_taskset *tset) | ||
| 598 | (cgroup_mutex held by caller) | 596 | (cgroup_mutex held by caller) |
| 599 | 597 | ||
| 600 | Called prior to moving one or more tasks into a cgroup; if the | 598 | Called prior to moving one or more tasks into a cgroup; if the |
| @@ -615,8 +613,7 @@ fork. If this method returns 0 (success) then this should remain valid | |||
| 615 | while the caller holds cgroup_mutex and it is ensured that either | 613 | while the caller holds cgroup_mutex and it is ensured that either |
| 616 | attach() or cancel_attach() will be called in future. | 614 | attach() or cancel_attach() will be called in future. |
| 617 | 615 | ||
| 618 | void cancel_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 616 | void cancel_attach(struct cgroup *cgrp, struct cgroup_taskset *tset) |
| 619 | struct cgroup_taskset *tset) | ||
| 620 | (cgroup_mutex held by caller) | 617 | (cgroup_mutex held by caller) |
| 621 | 618 | ||
| 622 | Called when a task attach operation has failed after can_attach() has succeeded. | 619 | Called when a task attach operation has failed after can_attach() has succeeded. |
| @@ -625,23 +622,22 @@ function, so that the subsystem can implement a rollback. If not, not necessary. | |||
| 625 | This will be called only about subsystems whose can_attach() operation have | 622 | This will be called only about subsystems whose can_attach() operation have |
| 626 | succeeded. The parameters are identical to can_attach(). | 623 | succeeded. The parameters are identical to can_attach(). |
| 627 | 624 | ||
| 628 | void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 625 | void attach(struct cgroup *cgrp, struct cgroup_taskset *tset) |
| 629 | struct cgroup_taskset *tset) | ||
| 630 | (cgroup_mutex held by caller) | 626 | (cgroup_mutex held by caller) |
| 631 | 627 | ||
| 632 | Called after the task has been attached to the cgroup, to allow any | 628 | Called after the task has been attached to the cgroup, to allow any |
| 633 | post-attachment activity that requires memory allocations or blocking. | 629 | post-attachment activity that requires memory allocations or blocking. |
| 634 | The parameters are identical to can_attach(). | 630 | The parameters are identical to can_attach(). |
| 635 | 631 | ||
| 636 | void fork(struct cgroup_subsy *ss, struct task_struct *task) | 632 | void fork(struct task_struct *task) |
| 637 | 633 | ||
| 638 | Called when a task is forked into a cgroup. | 634 | Called when a task is forked into a cgroup. |
| 639 | 635 | ||
| 640 | void exit(struct cgroup_subsys *ss, struct task_struct *task) | 636 | void exit(struct task_struct *task) |
| 641 | 637 | ||
| 642 | Called during task exit. | 638 | Called during task exit. |
| 643 | 639 | ||
| 644 | int populate(struct cgroup_subsys *ss, struct cgroup *cgrp) | 640 | int populate(struct cgroup *cgrp) |
| 645 | (cgroup_mutex held by caller) | 641 | (cgroup_mutex held by caller) |
| 646 | 642 | ||
| 647 | Called after creation of a cgroup to allow a subsystem to populate | 643 | Called after creation of a cgroup to allow a subsystem to populate |
| @@ -651,7 +647,7 @@ include/linux/cgroup.h for details). Note that although this | |||
| 651 | method can return an error code, the error code is currently not | 647 | method can return an error code, the error code is currently not |
| 652 | always handled well. | 648 | always handled well. |
| 653 | 649 | ||
| 654 | void post_clone(struct cgroup_subsys *ss, struct cgroup *cgrp) | 650 | void post_clone(struct cgroup *cgrp) |
| 655 | (cgroup_mutex held by caller) | 651 | (cgroup_mutex held by caller) |
| 656 | 652 | ||
| 657 | Called during cgroup_create() to do any parameter | 653 | Called during cgroup_create() to do any parameter |
| @@ -659,7 +655,7 @@ initialization which might be required before a task could attach. For | |||
| 659 | example in cpusets, no task may attach before 'cpus' and 'mems' are set | 655 | example in cpusets, no task may attach before 'cpus' and 'mems' are set |
| 660 | up. | 656 | up. |
| 661 | 657 | ||
| 662 | void bind(struct cgroup_subsys *ss, struct cgroup *root) | 658 | void bind(struct cgroup *root) |
| 663 | (cgroup_mutex and ss->hierarchy_mutex held by caller) | 659 | (cgroup_mutex and ss->hierarchy_mutex held by caller) |
| 664 | 660 | ||
| 665 | Called when a cgroup subsystem is rebound to a different hierarchy | 661 | Called when a cgroup subsystem is rebound to a different hierarchy |
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index fa8f26309444..1359d637831f 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
| @@ -28,13 +28,10 @@ static LIST_HEAD(blkio_list); | |||
| 28 | struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT }; | 28 | struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT }; |
| 29 | EXPORT_SYMBOL_GPL(blkio_root_cgroup); | 29 | EXPORT_SYMBOL_GPL(blkio_root_cgroup); |
| 30 | 30 | ||
| 31 | static struct cgroup_subsys_state *blkiocg_create(struct cgroup_subsys *, | 31 | static struct cgroup_subsys_state *blkiocg_create(struct cgroup *); |
| 32 | struct cgroup *); | 32 | static int blkiocg_can_attach(struct cgroup *, struct cgroup_taskset *); |
| 33 | static int blkiocg_can_attach(struct cgroup_subsys *, struct cgroup *, | 33 | static void blkiocg_attach(struct cgroup *, struct cgroup_taskset *); |
| 34 | struct cgroup_taskset *); | 34 | static void blkiocg_destroy(struct cgroup *); |
| 35 | static void blkiocg_attach(struct cgroup_subsys *, struct cgroup *, | ||
| 36 | struct cgroup_taskset *); | ||
| 37 | static void blkiocg_destroy(struct cgroup_subsys *, struct cgroup *); | ||
| 38 | static int blkiocg_populate(struct cgroup_subsys *, struct cgroup *); | 35 | static int blkiocg_populate(struct cgroup_subsys *, struct cgroup *); |
| 39 | 36 | ||
| 40 | /* for encoding cft->private value on file */ | 37 | /* for encoding cft->private value on file */ |
| @@ -1548,7 +1545,7 @@ static int blkiocg_populate(struct cgroup_subsys *subsys, struct cgroup *cgroup) | |||
| 1548 | ARRAY_SIZE(blkio_files)); | 1545 | ARRAY_SIZE(blkio_files)); |
| 1549 | } | 1546 | } |
| 1550 | 1547 | ||
| 1551 | static void blkiocg_destroy(struct cgroup_subsys *subsys, struct cgroup *cgroup) | 1548 | static void blkiocg_destroy(struct cgroup *cgroup) |
| 1552 | { | 1549 | { |
| 1553 | struct blkio_cgroup *blkcg = cgroup_to_blkio_cgroup(cgroup); | 1550 | struct blkio_cgroup *blkcg = cgroup_to_blkio_cgroup(cgroup); |
| 1554 | unsigned long flags; | 1551 | unsigned long flags; |
| @@ -1598,8 +1595,7 @@ static void blkiocg_destroy(struct cgroup_subsys *subsys, struct cgroup *cgroup) | |||
| 1598 | kfree(blkcg); | 1595 | kfree(blkcg); |
| 1599 | } | 1596 | } |
| 1600 | 1597 | ||
| 1601 | static struct cgroup_subsys_state * | 1598 | static struct cgroup_subsys_state *blkiocg_create(struct cgroup *cgroup) |
| 1602 | blkiocg_create(struct cgroup_subsys *subsys, struct cgroup *cgroup) | ||
| 1603 | { | 1599 | { |
| 1604 | struct blkio_cgroup *blkcg; | 1600 | struct blkio_cgroup *blkcg; |
| 1605 | struct cgroup *parent = cgroup->parent; | 1601 | struct cgroup *parent = cgroup->parent; |
| @@ -1628,8 +1624,7 @@ done: | |||
| 1628 | * of the main cic data structures. For now we allow a task to change | 1624 | * of the main cic data structures. For now we allow a task to change |
| 1629 | * its cgroup only if it's the only owner of its ioc. | 1625 | * its cgroup only if it's the only owner of its ioc. |
| 1630 | */ | 1626 | |
