| 1 |
cset(1) |
| 2 |
====== |
| 3 |
Alex Tsariounov <[email protected]> |
| 4 |
v1.6, December 2018 |
| 5 |
|
| 6 |
NAME |
| 7 |
---- |
| 8 |
cset - manage cpusets functions in the Linux kernel |
| 9 |
|
| 10 |
SYNOPSIS |
| 11 |
-------- |
| 12 |
[verse] |
| 13 |
'cset' [--version | --help | --tohex] |
| 14 |
'cset' [help <command> | <command> --help] |
| 15 |
'cset' [cset options] <command> [command options] [args] |
| 16 |
|
| 17 |
DESCRIPTION |
| 18 |
----------- |
| 19 |
NOTE: In general, you need to have root permissions to run cset. The |
| 20 |
tool mounts the cpusets filesystem and manipulates it. Non-root users |
| 21 |
do not have permission for these actions. |
| 22 |
|
| 23 |
Cset is a Python application to make using the cpusets facilities in |
| 24 |
the Linux kernel easier. The actual included command is called 'cset' |
| 25 |
and it allows manipulation of cpusets on the system and provides |
| 26 |
higher level functions such as implementation and control of a basic |
| 27 |
cpu shielding setup. |
| 28 |
|
| 29 |
Typical uses of cset include |
| 30 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 31 |
|
| 32 |
Setting up and managing a simple shielded CPU environment:: |
| 33 |
The concept of 'shielded' cpus is that a certain number of |
| 34 |
cpus are partitioned off on the system and only processes that |
| 35 |
are of interest are run on these cpus (i.e., inside the shield). |
| 36 |
+ |
| 37 |
For a simple shielded configuration, one typically uses three cpusets: |
| 38 |
the root set, a system set and a user set. 'Cset' includes a super |
| 39 |
command that implements this strategy and lets you easily manage it. |
| 40 |
See 'cset-shield(1)' for more details. |
| 41 |
|
| 42 |
Setting up and managing a complex shielding environment:: |
| 43 |
Shielding can be more complex of course where concepts such as |
| 44 |
priority cpusets and intersecting cpuset can be used. You can |
| 45 |
use 'cset' to help manage this type of shielding as well. You |
| 46 |
will need to use the 'cset-set(1)' and 'cset-proc(1)' |
| 47 |
subcommands directly to do that. |
| 48 |
|
| 49 |
Managing cpusets on the system:: |
| 50 |
The cset subcommand 'cset-set(1)' allows you to create and |
| 51 |
destroy arbitrary cpusets on the system and assign arbitrary |
| 52 |
cpus and memory nodes to them. The cpusets so created have to |
| 53 |
follow the Linux kernel cpuset rules. See the 'cset-set(1)' |
| 54 |
subcommand for more details. |
| 55 |
|
| 56 |
Managing processes that run on various system cpusets:: |
| 57 |
The cset subcommand 'cset-proc(1)' allows you to manage |
| 58 |
processes running on various cpusets created on the system. |
| 59 |
You can exec new processes in specific cpusets and move tasks |
| 60 |
around existing cpusets. See the 'cset-proc(1)' subcommand |
| 61 |
for more details. |
| 62 |
|
| 63 |
OPTIONS |
| 64 |
------- |
| 65 |
The following generic option flags are available. Additional options |
| 66 |
are available per-command, and documented in the command-specific |
| 67 |
documentation. |
| 68 |
|
| 69 |
'cset' --version:: |
| 70 |
Display version information and exits. |
| 71 |
|
| 72 |
'cset' --help:: |
| 73 |
Prints the synopsis and a list of all commands. |
| 74 |
|
| 75 |
'cset' --log <filename>:: |
| 76 |
Creates a log file for the current run. All manner of useful |
| 77 |
information is stored in this file. This is usually used to |
| 78 |
debug cset when things don't go as planned. |
| 79 |
|
| 80 |
'cset' --machine:: |
| 81 |
Makes cset output information for all operations in a format |
| 82 |
that is machine readable (i.e. easy to parse). |
| 83 |
|
| 84 |
'cset' --tohex <CPUSPEC>:: |
| 85 |
Converts a CPUSPEC (see 'cset-set(1)' for definition) to a |
| 86 |
hexadecimal number and outputs it. Useful for setting IRQ |
| 87 |
stub affinity to a cpuset definition. |
| 88 |
|
| 89 |
CSET COMMANDS |
| 90 |
------------- |
| 91 |
The cset commands are divided into groups, according to the primary |
| 92 |
purpose of those commands. Following is a short description of each |
| 93 |
command. A more detailed description is available in individual |
| 94 |
command manpages. Those manpages are named 'cset-<command>(1)'. The |
| 95 |
first command, 'help', is especially useful as it prints out a long |
| 96 |
summary of what a particular command does. |
| 97 |
|
| 98 |
'cset help command':: |
| 99 |
print out a lengthy summary of how the specified subcommand |
| 100 |
works |
| 101 |
'cset command --help':: |
| 102 |
print out an extended synopsis of the specified subcommand |
| 103 |
|
| 104 |
'cset shield':: |
| 105 |
supercommand to set up and manage basic shielding (see |
| 106 |
'cset-shield(1)') |
| 107 |
'cset set':: |
| 108 |
create, modify and destroy cpusets (see 'cset-set(1)') |
| 109 |
'cset proc':: |
| 110 |
create and manage processes within cpusets (see |
| 111 |
'cset-proc(1)') |
| 112 |
|
| 113 |
PERSISTENT CPUSETS |
| 114 |
------------------ |
| 115 |
To create a persistent cpuset setup, i.e. one that survives a reboot, |
| 116 |
you need to create the file '/etc/init.d/cset'. This distribution of |
| 117 |
cset includes an example cset init.d file found in |
| 118 |
'/usr/share/doc/pacakges/cpuset' which is called 'cset.init.d'. You |
| 119 |
will need to alter the file to your specifications and copy it to be |
| 120 |
the file '/etc/init.d/cset'. See the comments in that file for more |
| 121 |
details. |
| 122 |
|
| 123 |
FILES |
| 124 |
----- |
| 125 |
If used, the init.d script '/etc/init.d/cset' starts and stops a |
| 126 |
cpuset configuration on boot and poweroff. |
| 127 |
|
| 128 |
Cpuset uses a configuration file if present on the system. The file |
| 129 |
is '/etc/cset.conf' and may contain the following options. |
| 130 |
|
| 131 |
mountpoint = <directory_name>:: |
| 132 |
Specify the mountpoint where the cpuset filesystem is to be |
| 133 |
mounted. By default this is '/cpusets'; however, some people |
| 134 |
prefer to mount this in the more traditional '/dev/cpusets'. |
| 135 |
|
| 136 |
LICENSE |
| 137 |
------- |
| 138 |
Cpuset is licensed under the GNU GPL V2 only. |
| 139 |
|
| 140 |
COPYRIGHT |
| 141 |
--------- |
| 142 |
Copyright (c) 2008-2011 Novell Inc. |
| 143 |
|
| 144 |
AUTHOR |
| 145 |
------ |
| 146 |
Written by Alex Tsariounov <\[email protected]> |
| 147 |
|
| 148 |
Some substrate code and ideas were taken from the excellent Stacked |
| 149 |
GIT (stgit) v0.13 (see \http://gna.org/projects/stgit and |
| 150 |
\http://www.procode.org/stgit). Stacked GIT is under GPL V2 or later. |
| 151 |
|
| 152 |
SEE ALSO |
| 153 |
-------- |
| 154 |
cset-set(1), cset-proc(1), cset-shield(1) |
| 155 |
|
| 156 |
/usr/share/doc/packages/cpuset/html/tutorial.html |
| 157 |
|
| 158 |
/usr/share/doc/packages/cpuset/cset.init.d |
| 159 |
|
| 160 |
taskset(1), chrt(1) |
| 161 |
|
| 162 |
/usr/src/linux/Documentation/cpusets.txt |