Skip to contentSkip to conversation

cpusets: document adding/removing cpus to cpuset elaborately

PATCH Nikanth Karthikesan 6 participants 6 messages Jun 16, 2009 – Jun 19, 2009 Documentation

lore
Share & tools
lore
#0 lore raw

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 -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
 -----------------
 
#1 lore raw
Quoted 8 lines · Nikanth Karthikesan

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.

Hey,

Great to see that you are working on the documentation part. Have you given a try to test the CPUSET features in the kernel with the recently added tests from LTP(
http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/controllers/cpuset/)
? It would be great if you help us in improving them further.

Regards--
Subrata

Quoted 36 lines

---

Documentation/cgroups/cpusets.txt +12 -1
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
 -----------------
 
 
 
 
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 2 lines
Regards & Thanks--
Subrata

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw

Hi Nikanth,

Quoted 10 lines · Subrata Modak

On Tue, Jun 16, 2009 at 4:46 PM, Nikanth Karthikesan <[email protected]> wrote:
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.

Quoted 9 lines

Hey,

Great to see that you are working on the documentation part. Have you
given a try to test the CPUSET features in the kernel with the
recently added tests from
LTP(http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/controllers/cpuset/) ? It would be great if you help us in improving them further.

Would you like to share something with us ?

Regards--
Subrata

Quoted 40 lines

Regards--
Subrata

        ---
        
        diff --git a/Documentation/cgroups/cpusets.txt
        b/Documentation/cgroups/cpusets.txt
        index f9ca389..1d7e978 100644
        --- a/Documentation/cgroups/cpusets.txt
        +++ b/Documentation/cgroups/cpusets.txt
        @@ -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
         -----------------
Quoted 20 lines
        --
        To unsubscribe from this list: send the line "unsubscribe
        linux-kernel" in
        the body of a message to [email protected]
        More majordomo info at
         http://vger.kernel.org/majordomo-info.html
        Please read the FAQ at  http://www.tux.org/lkml/ 
Signature · 9 lines
Regards & Thanks--
Subrata 
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw

Re: [LTP] cpusets: document adding/removing cpus to cpusetelaborately

Quoted 24 lines
Quoted 3 lines
Quoted 3 lines · Subrata Modak

Hi Nikanth,

Quoted 10 lines · Subrata Modak

On Tue, Jun 16, 2009 at 4:46 PM, Nikanth Karthikesan <[email protected]> wrote:
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.

Quoted 8 lines

Hey,

Great to see that you are working on the documentation part. Have you given a try to test the CPUSET features in the kernel with the recently added tests from

Quoted 6 lines

LTP(http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/controller s/cpuset/) ? It would be great if you help us in improving them further.

Quoted 1 line

Would you like to share something with us ?

Hey Subrata

Great to hear from you. I was working on a patch that touches cpuset, and mis-understood the doc, hence the patch. But I haven't worked on it after that, as I was occupied with something else.

Thanks a lot for pointing me to the LTP test cases. It should help me. Surely, would use it when I get back to it, after I am back from vacation and and report my experience. :)

Thanks
Nikanth

Quoted 58 lines
Quoted 38 lines
 
 
         
         
        --- 
         
        diff --git a/Documentation/cgroups/cpusets.txt 
        b/Documentation/cgroups/cpusets.txt 
        index f9ca389..1d7e978 100644 
        --- a/Documentation/cgroups/cpusets.txt 
        +++ b/Documentation/cgroups/cpusets.txt 
        @@ -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 
         ----------------- 
Quoted 20 lines
        -- 
        To unsubscribe from this list: send the line "unsubscribe 
        linux-kernel" in 
        the body of a message to [email protected] 
        More majordomo info at 
         http://vger.kernel.org/majordomo-info.html 
        Please read the FAQ at  http://www.tux.org/lkml/  
Signature · 9 lines
Regards & Thanks-- 
Subrata  
------------------------------------------------------------------------------ 
Crystal Reports - New Free Runtime and 30 Day Trial 
Check out the new simplified licensing option that enables unlimited 
royalty-free distribution of the report engine for externally facing  
server and web deployment. 
http://p.sf.net/sfu/businessobjects 
_______________________________________________ Ltp-list mailing list  
Quoted 4 lines

[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Acked-by
#4 lore raw
In reply to Nikanth Karthikesan
Quoted 5 lines · Nikanth Karthikesan

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.

Though I think '>' already means overwrite so removing/adding cpus should always writing the full list of CPUs to 'cpus', more documentation to make cpuset usage clearer is not bad.

Quoted 27 lines

---

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
 -----------------
 
Acked-by
#5 lore raw
Quoted 9 lines · Li Zefan
Quoted 5 lines · Nikanth Karthikesan

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.

Though I think '>' already means overwrite so removing/adding cpus should always writing the full list of CPUs to 'cpus'

But in the context of cgroups/cpusets that's not always the case - think of the "tasks" file.

Quoted 2 lines

Paul