Skip to contentSkip to conversation

cpusets: document adding/removing cpus to cpuset elaborately

PATCH RESEND In review Li Zefan 1 participant 2 messages Jun 25, 2009 Documentation

lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH RESEND 1/1 cpusets: document adding/removing cpus to cpuset elaborately

Writing a pid to the file, tasks adds that task to that cgroup/cpuset. But to add a cpu/mem to a cpuset, the new list of cpus should be written to the cpuset.mems file which would replace the old list of cpus. Make this clearer in the documentation.

---
 Documentation/cgroups/cpusets.txt |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
Documentation/cgroups/cpusets.txt +12 -0
index f9ca389..1d7e978 100644
@@ -777,6 +777,18 @@ in cpuset directories:
 # /bin/echo 1-4 > cpus		-> set cpus list to cpus 1,2,3,4
 # /bin/echo 1,2,3,4 > cpus	-> set cpus list to cpus 1,2,3,4
 
+To add a CPU to a cpuset, write the new list of CPUs including the
+CPU to be added. To add 6 to the above cpuset:
+
+# /bin/echo 1-4,6 > cpus	-> set cpus list to cpus 1,2,3,4,6
+
+Similarly to remove a CPU from a cpuset, write the new list of CPUs
+without the CPU to be removed.
+
+To remove all the CPUs:
+
+# /bin/echo "" > cpus		-> clear cpus list
+
 2.3 Setting flags
 -----------------
 
author Acked-by Acked-by Paul Menage on v1 1/1
#1 lore raw

oops, I forgot the 'From' line.

=====================

From: Nikanth Karthikesan <[email protected]>

Writing a pid to the file, tasks adds that task to that cgroup/cpuset. But to add a cpu/mem to a cpuset, the new list of cpus should be written to the cpuset.mems file which would replace the old list of cpus. Make this clearer in the documentation.

---
 Documentation/cgroups/cpusets.txt |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
Documentation/cgroups/cpusets.txt +12 -0
index f9ca389..1d7e978 100644
@@ -777,6 +777,18 @@ in cpuset directories:
 # /bin/echo 1-4 > cpus		-> set cpus list to cpus 1,2,3,4
 # /bin/echo 1,2,3,4 > cpus	-> set cpus list to cpus 1,2,3,4
 
+To add a CPU to a cpuset, write the new list of CPUs including the
+CPU to be added. To add 6 to the above cpuset:
+
+# /bin/echo 1-4,6 > cpus	-> set cpus list to cpus 1,2,3,4,6
+
+Similarly to remove a CPU from a cpuset, write the new list of CPUs
+without the CPU to be removed.
+
+To remove all the CPUs:
+
+# /bin/echo "" > cpus		-> clear cpus list
+
 2.3 Setting flags
 -----------------