[PATCH] cgroup: Clarify documentation
Ian Molton
ian.molton at collabora.co.uk
Tue Dec 22 02:31:20 PST 2009
This patch clarifies the cgroup documentation, giving some info on why
the example given may fail, and a little more detail on its expected behaviour.
Signed-off-by: Ian Molton <ian.molton at collabora.co.uk>
---
Documentation/cgroups/cgroups.txt | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index 0b33bfe..8ac8615 100644
--- a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -309,7 +309,9 @@ the "cpuset" cgroup subsystem, the steps are something like:
For example, the following sequence of commands will setup a cgroup
named "Charlie", containing just CPUs 2 and 3, and Memory Node 1,
-and then start a subshell 'sh' in that cgroup:
+and then start a subshell 'sh' in that cgroup. Note that if you have no RAM
+on node 1 or dont have 4 CPUs you will want to modify the example
+accordingly:
mount -t cgroup cpuset -ocpuset /dev/cgroup
cd /dev/cgroup
@@ -317,7 +319,12 @@ and then start a subshell 'sh' in that cgroup:
cd Charlie
/bin/echo 2-3 > cpuset.cpus
/bin/echo 1 > cpuset.mems
+ # If you have no RAM on Node 0 the next command will return an error, eg.
+ # write error: No space left on device
/bin/echo $$ > tasks
+ # The current shell is now in cgroup Charlie. You can check this with:
+ cat /proc/self/cgroup
+ # Now launch a subshell which should inherit the cgroup:
sh
# The subshell 'sh' is now running in cgroup Charlie
# The next line should display '/Charlie'
--
1.6.5.7
More information about the Containers
mailing list