aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/cgroups
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2012-01-31 00:47:36 -0500
committerTejun Heo <tj@kernel.org>2012-02-02 12:20:22 -0500
commit761b3ef50e1c2649cffbfa67a4dcb2dcdb7982ed (patch)
tree67ab6a9a2520811c9c0b4d70d1c19b4bfca16237 /Documentation/cgroups
parent61d1d219c4c0761059236a46867bc49943c4d29d (diff)
cgroup: remove cgroup_subsys argument from callbacks
The argument is not used at all, and it's not necessary, because a specific callback handler of course knows which subsys it belongs to. Now only ->pupulate() takes this argument, because the handlers of this callback always call cgroup_add_file()/cgroup_add_files(). So we reduce a few lines of code, though the shrinking of object size is minimal. 16 files changed, 113 insertions(+), 162 deletions(-) text data bss dec hex filename 5486240 656987 7039960 13183187 c928d3 vmlinux.o.orig 5486170 656987 7039960 13183117 c9288d vmlinux.o Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'Documentation/cgroups')
-rw-r--r--Documentation/cgroups/cgroups.txt26
1 files changed, 11 insertions, 15 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
558methods are create/destroy. Any others that are null are presumed to 558methods are create/destroy. Any others that are null are presumed to
559be successful no-ops. 559be successful no-ops.
560 560
561struct cgroup_subsys_state *create(struct cgroup_subsys *ss, 561struct 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
565Called to create a subsystem state object for a cgroup. The 564Called 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
574it's the root of the hierarchy) and may be an appropriate place for 573it's the root of the hierarchy) and may be an appropriate place for
575initialization code. 574initialization code.
576 575
577void destroy(struct cgroup_subsys *ss, struct cgroup *cgrp) 576void destroy(struct cgroup *cgrp)
578(cgroup_mutex held by caller) 577(cgroup_mutex held by caller)
579 578
580The cgroup system is about to destroy the passed cgroup; the subsystem 579The 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
585newly-created cgroup if an error occurs after this subsystem's 584newly-created cgroup if an error occurs after this subsystem's
586create() method has been called for the new cgroup). 585create() method has been called for the new cgroup).
587 586
588int pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp); 587int pre_destroy(struct cgroup *cgrp);
589 588
590Called before checking the reference count on each subsystem. This may 589Called before checking the reference count on each subsystem. This may
591be useful for subsystems which have some extra references even if 590be 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,
593rmdir() will fail with it. From this behavior, pre_destroy() can be 592rmdir() will fail with it. From this behavior, pre_destroy() can be
594called multiple times against a cgroup. 593called multiple times against a cgroup.
595 594
596int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, 595int 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
600Called prior to moving one or more tasks into a cgroup; if the 598Called 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
615while the caller holds cgroup_mutex and it is ensured that either 613while the caller holds cgroup_mutex and it is ensured that either
616attach() or cancel_attach() will be called in future. 614attach() or cancel_attach() will be called in future.
617 615
618void cancel_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, 616void 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
622Called when a task attach operation has failed after can_attach() has succeeded. 619Called 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.
625This will be called only about subsystems whose can_attach() operation have 622This will be called only about subsystems whose can_attach() operation have
626succeeded. The parameters are identical to can_attach(). 623succeeded. The parameters are identical to can_attach().
627 624
628void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, 625void 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
632Called after the task has been attached to the cgroup, to allow any 628Called after the task has been attached to the cgroup, to allow any
633post-attachment activity that requires memory allocations or blocking. 629post-attachment activity that requires memory allocations or blocking.
634The parameters are identical to can_attach(). 630The parameters are identical to can_attach().
635 631
636void fork(struct cgroup_subsy *ss, struct task_struct *task) 632void fork(struct task_struct *task)
637 633
638Called when a task is forked into a cgroup. 634Called when a task is forked into a cgroup.
639 635
640void exit(struct cgroup_subsys *ss, struct task_struct *task) 636void exit(struct task_struct *task)
641 637
642Called during task exit. 638Called during task exit.
643 639
644int populate(struct cgroup_subsys *ss, struct cgroup *cgrp) 640int populate(struct cgroup *cgrp)
645(cgroup_mutex held by caller) 641(cgroup_mutex held by caller)
646 642
647Called after creation of a cgroup to allow a subsystem to populate 643Called 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
651method can return an error code, the error code is currently not 647method can return an error code, the error code is currently not
652always handled well. 648always handled well.
653 649
654void post_clone(struct cgroup_subsys *ss, struct cgroup *cgrp) 650void post_clone(struct cgroup *cgrp)
655(cgroup_mutex held by caller) 651(cgroup_mutex held by caller)
656 652
657Called during cgroup_create() to do any parameter 653Called during cgroup_create() to do any parameter
@@ -659,7 +655,7 @@ initialization which might be required before a task could attach. For
659example in cpusets, no task may attach before 'cpus' and 'mems' are set 655example in cpusets, no task may attach before 'cpus' and 'mems' are set
660up. 656up.
661 657
662void bind(struct cgroup_subsys *ss, struct cgroup *root) 658void 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
665Called when a cgroup subsystem is rebound to a different hierarchy 661Called when a cgroup subsystem is rebound to a different hierarchy