@@ -333,12 +333,23 @@ The "xxx" is not interpreted by the cgroup code, but will appear in
333333
334334To mount a cgroup hierarchy with just the cpuset and numtasks
335335subsystems, type:
336- # mount -t cgroup -o cpuset,numtasks hier1 /dev/cgroup
336+ # mount -t cgroup -o cpuset,memory hier1 /dev/cgroup
337337
338338To change the set of subsystems bound to a mounted hierarchy, just
339339remount with different options:
340+ # mount -o remount,cpuset,ns hier1 /dev/cgroup
340341
341- # mount -o remount,cpuset,ns /dev/cgroup
342+ Now memory is removed from the hierarchy and ns is added.
343+
344+ Note this will add ns to the hierarchy but won't remove memory or
345+ cpuset, because the new options are appended to the old ones:
346+ # mount -o remount,ns /dev/cgroup
347+
348+ To Specify a hierarchy's release_agent:
349+ # mount -t cgroup -o cpuset,release_agent="/sbin/cpuset_release_agent" \
350+ xxx /dev/cgroup
351+
352+ Note that specifying 'release_agent' more than once will return failure.
342353
343354Note that changing the set of subsystems is currently only supported
344355when the hierarchy consists of a single (root) cgroup. Supporting
@@ -349,6 +360,11 @@ Then under /dev/cgroup you can find a tree that corresponds to the
349360tree of the cgroups in the system. For instance, /dev/cgroup
350361is the cgroup that holds the whole system.
351362
363+ If you want to change the value of release_agent:
364+ # echo "/sbin/new_release_agent" > /dev/cgroup/release_agent
365+
366+ It can also be changed via remount.
367+
352368If you want to create a new cgroup under /dev/cgroup:
353369# cd /dev/cgroup
354370# mkdir my_cgroup
@@ -476,11 +492,13 @@ cgroup->parent is still valid. (Note - can also be called for a
476492newly-created cgroup if an error occurs after this subsystem's
477493create() method has been called for the new cgroup).
478494
479- void pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp);
495+ int pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp);
480496
481497Called before checking the reference count on each subsystem. This may
482498be useful for subsystems which have some extra references even if
483- there are not tasks in the cgroup.
499+ there are not tasks in the cgroup. If pre_destroy() returns error code,
500+ rmdir() will fail with it. From this behavior, pre_destroy() can be
501+ called multiple times against a cgroup.
484502
485503int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
486504 struct task_struct *task)
0 commit comments