diff options
author | Rami Rosen <ramirose@gmail.com> | 2013-04-10 07:41:17 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-04-10 13:46:59 -0400 |
commit | 84cfb6ab484b442d5115eb3baf9db7d74a3ea626 (patch) | |
tree | 3a3d52372b7b6f0e42662103baa8f0ef24789bf2 | |
parent | 8adf12b0ffd0a10340bab355e586f8533a69630d (diff) |
cgroup: remove bind() method from cgroup_subsys.
The bind() method of cgroup_subsys is not used in any of the
controllers (cpuset, freezer, blkio, net_cls, memcg, net_prio,
devices, perf, hugetlb, cpu and cpuacct)
tj: Removed the entry on ->bind() from
Documentation/cgroups/cgroups.txt. Also updated a couple
paragraphs which were suggesting that dynamic re-binding may be
implemented. It's not gonna.
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r-- | Documentation/cgroups/cgroups.txt | 20 | ||||
-rw-r--r-- | include/linux/cgroup.h | 2 | ||||
-rw-r--r-- | kernel/cgroup.c | 4 |
3 files changed, 5 insertions, 21 deletions
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index 638bf17ff869..2b51e12ce178 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt | |||
@@ -211,10 +211,9 @@ matches, and any of the requested subsystems are in use in an existing | |||
211 | hierarchy, the mount will fail with -EBUSY. Otherwise, a new hierarchy | 211 | hierarchy, the mount will fail with -EBUSY. Otherwise, a new hierarchy |
212 | is activated, associated with the requested subsystems. | 212 | is activated, associated with the requested subsystems. |
213 | 213 | ||
214 | It's not currently possible to bind a new subsystem to an active | 214 | It's not possible to bind a new subsystem to an active cgroup |
215 | cgroup hierarchy, or to unbind a subsystem from an active cgroup | 215 | hierarchy, or to unbind a subsystem from an active cgroup |
216 | hierarchy. This may be possible in future, but is fraught with nasty | 216 | hierarchy. |
217 | error-recovery issues. | ||
218 | 217 | ||
219 | When a cgroup filesystem is unmounted, if there are any | 218 | When a cgroup filesystem is unmounted, if there are any |
220 | child cgroups created below the top-level cgroup, that hierarchy | 219 | child cgroups created below the top-level cgroup, that hierarchy |
@@ -382,10 +381,8 @@ To Specify a hierarchy's release_agent: | |||
382 | 381 | ||
383 | Note that specifying 'release_agent' more than once will return failure. | 382 | Note that specifying 'release_agent' more than once will return failure. |
384 | 383 | ||
385 | Note that changing the set of subsystems is currently only supported | 384 | Note that changing the set of subsystems is only supported when the |
386 | when the hierarchy consists of a single (root) cgroup. Supporting | 385 | hierarchy consists of a single (root) cgroup. |
387 | the ability to arbitrarily bind/unbind subsystems from an existing | ||
388 | cgroup hierarchy is intended to be implemented in the future. | ||
389 | 386 | ||
390 | Then under /sys/fs/cgroup/rg1 you can find a tree that corresponds to the | 387 | Then under /sys/fs/cgroup/rg1 you can find a tree that corresponds to the |
391 | tree of the cgroups in the system. For instance, /sys/fs/cgroup/rg1 | 388 | tree of the cgroups in the system. For instance, /sys/fs/cgroup/rg1 |
@@ -643,13 +640,6 @@ void exit(struct task_struct *task) | |||
643 | 640 | ||
644 | Called during task exit. | 641 | Called during task exit. |
645 | 642 | ||
646 | void bind(struct cgroup *root) | ||
647 | (cgroup_mutex held by caller) | ||
648 | |||
649 | Called when a cgroup subsystem is rebound to a different hierarchy | ||
650 | and root cgroup. Currently this will only involve movement between | ||
651 | the default hierarchy (which never has sub-cgroups) and a hierarchy | ||
652 | that is being created/destroyed (and hence has no sub-cgroups). | ||
653 | 643 | ||
654 | 4. Extended attribute usage | 644 | 4. Extended attribute usage |
655 | =========================== | 645 | =========================== |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 515927eebb37..92acf8601ae0 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -483,8 +483,6 @@ struct cgroup_subsys { | |||
483 | void (*fork)(struct task_struct *task); | 483 | void (*fork)(struct task_struct *task); |
484 | void (*exit)(struct cgroup *cgrp, struct cgroup *old_cgrp, | 484 | void (*exit)(struct cgroup *cgrp, struct cgroup *old_cgrp, |
485 | struct task_struct *task); | 485 | struct task_struct *task); |
486 | void (*bind)(struct cgroup *root); | ||
487 | |||
488 | int subsys_id; | 486 | int subsys_id; |
489 | int active; | 487 | int active; |
490 | int disabled; | 488 | int disabled; |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index ba3e24a76dae..fd38e1cfacca 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -1064,16 +1064,12 @@ static int rebind_subsystems(struct cgroupfs_root *root, | |||
1064 | cgrp->subsys[i]->cgroup = cgrp; | 1064 | cgrp->subsys[i]->cgroup = cgrp; |
1065 | list_move(&ss->sibling, &root->subsys_list); | 1065 | list_move(&ss->sibling, &root->subsys_list); |
1066 | ss->root = root; | 1066 | ss->root = root; |
1067 | if (ss->bind) | ||
1068 | ss->bind(cgrp); | ||
1069 | /* refcount was already taken, and we're keeping it */ | 1067 | /* refcount was already taken, and we're keeping it */ |
1070 | } else if (bit & removed_mask) { | 1068 | } else if (bit & removed_mask) { |
1071 | /* We're removing this subsystem */ | 1069 | /* We're removing this subsystem */ |
1072 | BUG_ON(ss == NULL); | 1070 | BUG_ON(ss == NULL); |
1073 | BUG_ON(cgrp->subsys[i] != dummytop->subsys[i]); | 1071 | BUG_ON(cgrp->subsys[i] != dummytop->subsys[i]); |
1074 | BUG_ON(cgrp->subsys[i]->cgroup != cgrp); | 1072 | BUG_ON(cgrp->subsys[i]->cgroup != cgrp); |
1075 | if (ss->bind) | ||
1076 | ss->bind(dummytop); | ||
1077 | dummytop->subsys[i]->cgroup = dummytop; | 1073 | dummytop->subsys[i]->cgroup = dummytop; |
1078 | cgrp->subsys[i] = NULL; | 1074 | cgrp->subsys[i] = NULL; |
1079 | subsys[i]->root = &rootnode; | 1075 | subsys[i]->root = &rootnode; |