aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/cgroups/cgroups.txt
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2009-04-02 19:57:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-02 22:04:54 -0400
commitec64f51545fffbc4cb968f0cea56341a4b07e85a (patch)
tree575d890a6759d81f3324fa2a22ca6ab14a41eefc /Documentation/cgroups/cgroups.txt
parent38460b48d06440de46b34cb778bd6c4855030754 (diff)
cgroup: fix frequent -EBUSY at rmdir
In following situation, with memory subsystem, /groupA use_hierarchy==1 /01 some tasks /02 some tasks /03 some tasks /04 empty When tasks under 01/02/03 hit limit on /groupA, hierarchical reclaim is triggered and the kernel walks tree under groupA. In this case, rmdir /groupA/04 fails with -EBUSY frequently because of temporal refcnt from the kernel. In general. cgroup can be rmdir'd if there are no children groups and no tasks. Frequent fails of rmdir() is not useful to users. (And the reason for -EBUSY is unknown to users.....in most cases) This patch tries to modify above behavior, by - retries if css_refcnt is got by someone. - add "return value" to pre_destroy() and allows subsystem to say "we're really busy!" Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Paul Menage <menage@google.com> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/cgroups/cgroups.txt')
-rw-r--r--Documentation/cgroups/cgroups.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index 93feb8444489..cdc46a501b85 100644
--- a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -476,11 +476,13 @@ cgroup->parent is still valid. (Note - can also be called for a
476newly-created cgroup if an error occurs after this subsystem's 476newly-created cgroup if an error occurs after this subsystem's
477create() method has been called for the new cgroup). 477create() method has been called for the new cgroup).
478 478
479void pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp); 479int pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp);
480 480
481Called before checking the reference count on each subsystem. This may 481Called before checking the reference count on each subsystem. This may
482be useful for subsystems which have some extra references even if 482be useful for subsystems which have some extra references even if
483there are not tasks in the cgroup. 483there are not tasks in the cgroup. If pre_destroy() returns error code,
484rmdir() will fail with it. From this behavior, pre_destroy() can be
485called multiple times against a cgroup.
484 486
485int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, 487int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
486 struct task_struct *task) 488 struct task_struct *task)