Cpuset Management Utility

From RTwiki
(Difference between revisions)
Jump to: navigation, search
m (Protected "Cpuset Management Utility": This page has been migrated to the Linux Foundation RT wiki. (‎[edit=sysop] (indefinite) ‎[move=sysop] (indefinite)))
(moved to new dokuwiki)
 
Line 1: Line 1:
Current Version: '''1.5.6'''
 
  
Cpuset is a GPL v2 Python application to make using the cpusets facilities in the Linux kernel easier. The actual included command is called cset and it allows manipulation of cpusets on the system and provides higher level functions such as implementation and control of a basic cpu shielding setup. Cpuset is developed at [http://www.novell.com Novell] as part of the [http://www.novell.com/realtime SLERT 10 SP2, SP3, and SLERT 11] as well as the [http://www.novell.com/products/server SLES 11] releases.
+
<div style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#f9e9e9; align:right;">
 
+
<b>This wiki is being migrated to the Linux Foundation Real-Time Linux Project hosted wiki. The new page is available at: https://wiki.linuxfoundation.org/realtime/documentation/howto/tools/cpu-partitioning/cset. This page is now deprecated.</b>
'''Note:''' you need to be root to perform most of the functions that cpuset implements.
+
</div>
 
+
The cpuset project is hosted on a [http://code.google.com/p/cpuset Google code hosting site].  You will find there the public [http://code.google.com/p/cpuset/source/checkout mercurial source repository] and a public [http://code.google.com/p/cpuset/issues/list bug tracking facility].  The author of the cpuset tool is Alex Tsariounov <alext at novell dot com>.
+
 
+
{{HINT|Binary packages for many distributions are available via the [http://download.opensuse.org/repositories/home:/tsariounov:/cpuset/ openSUSE Build Service here.]}}
+
 
+
{{NOTE|An in-depth tutorial for both basic shielding and advanced cpuset manipulation using [[Cpuset Management Utility/tutorial | cset can be found here.]]}}
+
 
+
==A Quick Tour of Cpuset==
+
 
+
The cpuset utility (called cset after install) includes three commands: "set", which is used for creating and managing cpusets; "proc", which is used to manage processes in those sets; and "shield", which is a ''supercommand'' that implements a basic CPU shielding methodology.
+
 
+
Here is a quick reference on the cset command:
+
 
+
For an in-depth [[Cpuset Management Utilty/shield_writeup | <u>write up of the shield supercommand</u>]]:
+
    # cset help shield
+
To see the options for the shield supercommand:
+
    # cset shield --help
+
 
+
For an in-depth [[Cpuset Management Utility/set_writeup | <u>write up of the set subcommand</u>]] (cpuset management):
+
    # cset help set
+
To see the options for the set command:
+
    # cset set --help
+
 
+
For an in-depth [[Cpuset Management Utilty/proc_writeup | <u>write up of the proc subcommand</u>]] (process management):
+
    # cset help proc
+
To see the options for the proc command:
+
    # cset proc --help
+
 
+
===Using cpuset to implement shielding===
+
See [[Cpuset Management Utility/tutorial | <u>the cset tutorial</u>]] for an in-depth discussion.
+
 
+
To create a shield, for example on a 4-way machine, shielding cpus 1,2,3 and leaving cpu 0 for system tasks (unshielded):
+
    # cset shield --cpu 1-3
+
 
+
To move kernel threads from the root cpuset (all processors) to the system processors (unshielded cpus):
+
    # cset shield --kthread on
+
 
+
To run a program in the shield, ie. on the shielded processors:
+
    # cset shield --exec /opt/path/bin/my_code
+
 
+
To move a set of already running processes and threads (tasks) into the shield:
+
    # cset shield --shield 2242,2244,3000-3100
+
 
+
To move a set of already running tasks in the shield out of the shield:
+
    # cset shield --unshield 3000-3100
+
 
+
To destroy the shield and return all processes to the root cpuset (ie. all cpus):
+
    # cset shield --reset
+
 
+
Note that all of the above long options also have corresponding short option. A nice way to experiment with shielding is to first set up a shield and then run a shell on it. Since the cpuset property is inherited for children, all processes run in that shell will be in the shield, for example:
+
    # cset shield -c 1-3
+
    # cset shield -e bash
+
    $ run_my_code
+

Latest revision as of 10:01, 21 December 2017

This wiki is being migrated to the Linux Foundation Real-Time Linux Project hosted wiki. The new page is available at: https://wiki.linuxfoundation.org/realtime/documentation/howto/tools/cpu-partitioning/cset. This page is now deprecated.

Personal tools