[PATCH] Documentation: cgroups: Add notes on removing PIDs from tasks and cgroups requiring setup

March 09th, 2011 - 04:20 pm ET by Eric B Munson | Report spam
The cgroup documentation does not specify how a process can be removed from a
particular group. This patch adds a note at the end of the simple example
about how this is done. Also, some cgroups (like cpusets) require user input
before a new group can be used. This is noted in the patch as well.

Signed-off-by: Eric B Munson <emunson@mgebm.net>

Documentation/cgroups/cgroups.txt | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index 44b8b7a..6c975a1 100644
a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -349,6 +349,10 @@ To mount a cgroup hierarchy with all available subsystems, type:
The "xxx" is not interpreted by the cgroup code, but will appear in
/proc/mounts so may be any useful identifying string that you like.

+Note: Some subsystems do not work without some user input first. For instance,
+if cpusets are enabled the user will have to populate the cpus and mems files
+for each new cgroup created before that group can be used.
+
To mount a cgroup hierarchy with just the cpuset and memory
subsystems, type:
# mount -t cgroup -o cpuset,memory hier1 /dev/cgroup
@@ -426,6 +430,9 @@ You can attach the current shell task by echoing 0:

# echo 0 > tasks

+Note: To remove a task from a cgroup you must write its PID to the root
+tasks file.
+
2.3 Mounting hierarchies by name

1.7.1

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
email Follow the discussionReplies 4 repliesReplies Make a reply

Similar topics

Replies

#1 Kirill A. Shutemov
March 09th, 2011 - 06:10 pm ET | Report spam
On Wed, Mar 09, 2011 at 04:09:29PM -0500, Eric B Munson wrote:
The cgroup documentation does not specify how a process can be removed from a
particular group. This patch adds a note at the end of the simple example
about how this is done. Also, some cgroups (like cpusets) require user input
before a new group can be used. This is noted in the patch as well.

Signed-off-by: Eric B Munson

Documentation/cgroups/cgroups.txt | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index 44b8b7a..6c975a1 100644
a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -349,6 +349,10 @@ To mount a cgroup hierarchy with all available subsystems, type:
The "xxx" is not interpreted by the cgroup code, but will appear in
/proc/mounts so may be any useful identifying string that you like.

+Note: Some subsystems do not work without some user input first. For instance,
+if cpusets are enabled the user will have to populate the cpus and mems files
+for each new cgroup created before that group can be used.
+
To mount a cgroup hierarchy with just the cpuset and memory
subsystems, type:
# mount -t cgroup -o cpuset,memory hier1 /dev/cgroup
@@ -426,6 +430,9 @@ You can attach the current shell task by echoing 0:

# echo 0 > tasks

+Note: To remove a task from a cgroup you must write its PID to the root
+tasks file.
+



'to tasks file of another cgroup.'?

2.3 Mounting hierarchies by name

1.7.1

_______________________________________________
Containers mailing list

https://lists.linux-foundation.org/...containers



Kirill A. Shutemov
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Replies Reply to this message
#2 Paul Menage
March 09th, 2011 - 06:20 pm ET | Report spam
On Wed, Mar 9, 2011 at 1:09 PM, Eric B Munson wrote:

+Note: To remove a task from a cgroup you must write its PID to the root
+tasks file.
+



This isn't really accurate - the root cgroup is a cgroup like all the
others. More accurate would be something like:

Since every task is always a member of exactly one cgroup in each
mounted hierarchy, to remove a task from its current cgroup you must
move it into a new cgroup (possibly the root cgroup) by writing to the
new cgroup's tasks file.

Paul
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Replies Reply to this message
#3 Mike Heffner
March 10th, 2011 - 09:50 am ET | Report spam
On 03/09/2011 06:13 PM, Paul Menage wrote:
On Wed, Mar 9, 2011 at 1:09 PM, Eric B Munson wrote:

+Note: To remove a task from a cgroup you must write its PID to the root
+tasks file.
+



This isn't really accurate - the root cgroup is a cgroup like all the
others. More accurate would be something like:

Since every task is always a member of exactly one cgroup in each
mounted hierarchy, to remove a task from its current cgroup you must
move it into a new cgroup (possibly the root cgroup) by writing to the
new cgroup's tasks file.




If we are updating this documentation, can we include a blurb that
mentions if the 'ns' cgroup is mounted in the hierarchy, moving a
process to a new cgroup can fail?


Mike

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Replies Reply to this message
#4 Eric B Munson
March 10th, 2011 - 12:00 pm ET | Report spam

On Wed, 09 Mar 2011, Paul Menage wrote:

On Wed, Mar 9, 2011 at 1:09 PM, Eric B Munson wrote:
>
> +Note: To remove a task from a cgroup you must write its PID to the root
> +tasks file.
> +

This isn't really accurate - the root cgroup is a cgroup like all the
others. More accurate would be something like:

Since every task is always a member of exactly one cgroup in each
mounted hierarchy, to remove a task from its current cgroup you must
move it into a new cgroup (possibly the root cgroup) by writing to the
new cgroup's tasks file.

Paul




I am going to lift that for V2.



To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search