move specified tasks to specified cpuset; to move a PIDSPEC to a cpuset, use \-m PIDSPEC cpuset; to move all tasks specify \-\-fromset and \-\-toset
.TP
.RE
.PP
\-p PIDSPEC, \-\-pid=PIDSPEC
.RS4
specify pid or tid specification
.TP
.RE
.PP
\-\-threads
.RS4
if specified, any processes found in the PIDSPEC to have multiple threads will automatically have all their threads added to the PIDSPEC (use to move all related threads to a cpuset)
.TP
.RE
.PP
\-s CPUSET, \-\-set=CPUSET
.RS4
specify name of immediate cpuset
.TP
.RE
.PP
\-t TOSET, \-\-toset=TOSET
.RS4
specify name of destination cpuset
.TP
.RE
.PP
\-f FROMSET, \-\-fromset=FROMSET
.RS4
specify name of origination cpuset
.TP
.RE
.PP
\-k, \-\-kthread
.RS4
move, or include moving, unbound kernel threads
.TP
.RE
.PP
\-\-force
.RS4
force all processes and threads to be moved
.TP
.RE
.PP
\-v, \-\-verbose
.RS4
prints more detailed output, additive
.RE
.SH"DESCRIPTION"
This command is used to run and manage arbitrary processes on specified cpusets. It is also used to move pre\-existing processes and threads to specified cpusets. You may note there is no "kill" or "destroy" option \(em use the standard OS ^C or kill commands for that.
This command is used to run and manage arbitrary processes on specified cpusets\&. It is also used to move pre\-existing processes and threads to specified cpusets\&. You may note there is no "kill" or "destroy" option \(em use the standard OS ^C or kill commands for that\&.
To list which tasks are running in a particular cpuset, use the \-\-list command.
To list which tasks are running in a particular cpuset, use the \-\-list command\&.
For example:
\fB# cset proc \-\-list \-\-set myset\fR
This command will list all the tasks running in the cpuset called "myset".
This command will list all the tasks running in the cpuset called "myset"\&.
Processes are created by specifying the path to the executable and specifying the cpuset that the process is to be created in.
Processes are created by specifying the path to the executable and specifying the cpuset that the process is to be created in\&.
This command will execute the /usr/bin/fast_code program on the "blazing_cpuset" cpuset.
This command will execute the /usr/bin/fast_code program on the "blazing_cpuset" cpuset\&.
Note that if your command takes options, then use the traditional "\-\-" marker to separate cset\(cqs options from your command\(cqs options.
Note that if your command takes options, then use the traditional "\-\-" marker to separate cset\(cqs options from your command\(cqs options\&.
For example:
\fB# cset proc \-\-set myset \-\-exec \(em ls \-l\fR
This command will execute "ls \-l" on the cpuset called "myset".
This command will execute "ls \-l" on the cpuset called "myset"\&.
The PIDSPEC argument taken for the move command is a comma separated list of PIDs or TIDs. The list can also include brackets of PIDs or TIDs (i.e. tasks) that are inclusive of the endpoints.
The PIDSPEC argument taken for the move command is a comma separated list of PIDs or TIDs\&. The list can also include brackets of PIDs or TIDs (i\&.e\&. tasks) that are inclusive of the endpoints\&.
For example:
.sp
.ifn\{\
.RS4
.\}
.nf
1,2,5 Means processes 1, 2 and 5
1,2,600\-700 Means processes 1, 2 and from 600 to 700
.fi
.ifn\{\
.RE
.\}
.sp
.ifn\{\
.sp
.\}
.RS4
.it1an-trap
.nran-no-space-flag1
.nran-break-flag1
.br
.ps+1
\fBNote\fR
The range of PIDs or TIDs does not need to have every position populated. In other words, for the example above, if there is only one process, say PID 57, in the range of 50\-65, then only that process will be moved.
To move a PIDSPEC to a specific cpuset, you can either specify the PIDSPEC with \-\-pid and the destination cpuset with \-\-toset, or use the short hand and list the cpuset name after the PIDSPEC for the \-\-move arguments.
.ps-1
.br
The range of PIDs or TIDs does not need to have every position populated\&. In other words, for the example above, if there is only one process, say PID 57, in the range of 50\-65, then only that process will be moved\&.
.sp.5v
.RE
To move a PIDSPEC to a specific cpuset, you can either specify the PIDSPEC with \-\-pid and the destination cpuset with \-\-toset, or use the short hand and list the cpuset name after the PIDSPEC for the \-\-move arguments\&.
The move command accepts multiple common calling methods. For example, the following commands are equivalent:
The move command accepts multiple common calling methods\&. For example, the following commands are equivalent:
These commands move the tasks defined as 2442 and any running task between 3000 and 3200 inclusive of the ends to the cpuset called "reserved_set".
These commands move the tasks defined as 2442 and any running task between 3000 and 3200 inclusive of the ends to the cpuset called "reserved_set"\&.
Specifying the \-\-fromset is not necessary since the tasks will be moved to the destination cpuset no matter which cpuset they are currently running on.
Specifying the \-\-fromset is not necessary since the tasks will be moved to the destination cpuset no matter which cpuset they are currently running on\&.
.ifn\{\
.sp
.\}
.RS4
.it1an-trap
.nran-no-space-flag1
.nran-break-flag1
.br
.ps+1
\fBNote\fR
However, if you do specify a cpuset with the \-\-fromset option, then only those tasks that are both in the PIDSPEC \fBand\fR are running in the cpuset specified by \-\-fromset will be moved. I.e., if there is a task running on the system but not in \-\-fromset that is in PIDSPEC, it will not be moved.
If the \-\-threads switch is used, then the proc command will gather any threads of belonging to any processes or threads that are specified in the PIDSPEC and move them. This provides an easy way to move all related threads: just pick one TID from the set and use the \-\-threads option.
.ps-1
.br
However, if you do specify a cpuset with the \-\-fromset option, then only those tasks that are both in the PIDSPEC \fBand\fR are running in the cpuset specified by \-\-fromset will be moved\&. I\&.e\&., if there is a task running on the system but not in \-\-fromset that is in PIDSPEC, it will not be moved\&.
.sp.5v
.RE
If the \-\-threads switch is used, then the proc command will gather any threads of belonging to any processes or threads that are specified in the PIDSPEC and move them\&. This provides an easy way to move all related threads: just pick one TID from the set and use the \-\-threads option\&.
To move all userspace tasks from one cpuset to another, you need to specify the source and destination cpuset by name.
To move all userspace tasks from one cpuset to another, you need to specify the source and destination cpuset by name\&.
This command specifies that all processes and threads running on cpuset "comp1" be moved to cpuset "comp42".
This command specifies that all processes and threads running on cpuset "comp1" be moved to cpuset "comp42"\&.
.ifn\{\
.sp
.\}
.RS4
.it1an-trap
.nran-no-space-flag1
.nran-break-flag1
.br
.ps+1
\fBNote\fR
This move command will not move kernel threads unless the \-k/\-\-kthread switch is specified. If it is, then all unbound kernel threads will be added to the move. Unbound kernel threads are those that can run on any CPU. If you \fBalso specify\fR the \-\-force switch, then all tasks, kernel or not, bound or not, will be moved.
.ps-1
.br
This move command will not move kernel threads unless the \-k/\-\-kthread switch is specified\&. If it is, then all unbound kernel threads will be added to the move\&. Unbound kernel threads are those that can run on any CPU\&. If you \fBalso specify\fR the \-\-force switch, then all tasks, kernel or not, bound or not, will be moved\&.
.sp.5v
.RE
.ifn\{\
.sp
.\}
.RS4
.it1an-trap
.nran-no-space-flag1
.nran-break-flag1
.br
.ps+1
\fBCaution\fR
Please be cautious with the \-\-force switch, since moving a kernel thread that is bound to a specific CPU to a cpuset that does not include that CPU can cause a system hang.
You must specify unique cpuset names for the both exec and move commands. If a simple name passed to the \-\-fromset, \-\-toset and \-\-set parameters is unique on the system then that command executes. However, if there are multiple cpusets by that name, then you will need to specify which one you mean with a full path rooted at the base cpuset tree.
.ps-1
.br
Please be cautious with the \-\-force switch, since moving a kernel thread that is bound to a specific CPU to a cpuset that does not include that CPU can cause a system hang\&.
.sp.5v
.RE
You must specify unique cpuset names for the both exec and move commands\&. If a simple name passed to the \-\-fromset, \-\-toset and \-\-set parameters is unique on the system then that command executes\&. However, if there are multiple cpusets by that name, then you will need to specify which one you mean with a full path rooted at the base cpuset tree\&.
For example, suppose you have the following cpuset tree:
.sp
.ifn\{\
.RS4
.\}
.nf
/cpusets
/group1
@ -166,23 +246,27 @@ For example, suppose you have the following cpuset tree:
/myset
/yourset
.fi
.ifn\{\
.RE
.\}
.sp
Then, to move a process from myset in group1 to yourset in group2, you would have to issue the following command:
You do not have to worry about where in the Linux filesystem the cpuset filesystem is mounted. The cset command takes care of that. Any cpusets that are specified by path (such as above), are done with respect to the root of the cpuset filesystem.
You do not have to worry about where in the Linux filesystem the cpuset filesystem is mounted\&. The cset command takes care of that\&. Any cpusets that are specified by path (such as above), are done with respect to the root of the cpuset filesystem\&.
.SH"LICENSE"
Cpuset is licensed under the GNU GPL V2 only.
Cpuset is licensed under the GNU GPL V2 only\&.
.SH"COPYRIGHT"
Copyright (c) 2008\-2009 Novell Inc.
Copyright (c) 2008\-2010 Novell Inc\&.
.SH"AUTHOR"
Written by Alex Tsariounov <alext@novell.com>.
Written by Alex Tsariounov <alext@novell\&.com>\&.
@ -26,81 +37,103 @@ cset\-set \- manage sets of cpus
\fIcset\fR set \-\-destroy /mygroup_sets/my_set
.fi
.SH"OPTIONS"
.TP
.PP
\-h, \-\-help
.RS4
prints the list of options for this command
.TP
.RE
.PP
\-l, \-\-list
.RS4
list the named cpuset(s); if \-a is used, will list members of named cpuset; if \-r is used, will list recursively
.TP
.RE
.PP
\-c CPUSPEC, \-\-cpu=CPUSPEC
.RS4
create or modify cpuset in the specified cpuset with CPUSPEC specification
.TP
.RE
.PP
\-m MEMSPEC, \-\-mem=MEMSPEC
.RS4
specify which memory nodes to assign to the created or modified cpuset
.TP
.RE
.PP
\-d, \-\-destroy
.RS4
destroy specified cpuset
.TP
.RE
.PP
\-s CPUSET, \-\-set=CPUSET
.RS4
specify cpuset name to be acted on
.TP
.RE
.PP
\-r, \-\-recurse
.RS4
do recursive listing, for use with \-\-list
.TP
.RE
.PP
\-v, \-\-verbose
.RS4
prints more detailed output, for the set command, using this flag will not chop listing to fit in 80 columns
.TP
.RE
.PP
\-\-cpu_exclusive
.RS4
mark this cpuset as owning its CPUs exclusively
.TP
.RE
.PP
\-\-mem_exclusive
.RS4
mark this cpuset as owning its MEMs exclusively
.RE
.SH"DESCRIPTION"
This command is used to create, modify, and destroy cpusets. Cpusets form a tree\-like structure rooted at the root cpuset which always includes all system CPUs and all system memory nodes.
This command is used to create, modify, and destroy cpusets\&. Cpusets form a tree\-like structure rooted at the root cpuset which always includes all system CPUs and all system memory nodes\&.
A cpuset is an organizational unit that defines a group of CPUs and a group of memory nodes where a process or thread (i.e. task) is allowed to run on. For non\-NUMA machines, the memory node is always 0 (zero) and cannot be set to anything else. For NUMA machines, the memory node can be set to a similar specification as the CPU definition and will tie those memory nodes to that cpuset. You will usually want the memory nodes that belong to the CPUs defined to be in the same cpuset.
A cpuset is an organizational unit that defines a group of CPUs and a group of memory nodes where a process or thread (i\&.e\&. task) is allowed to run on\&. For non\-NUMA machines, the memory node is always 0 (zero) and cannot be set to anything else\&. For NUMA machines, the memory node can be set to a similar specification as the CPU definition and will tie those memory nodes to that cpuset\&. You will usually want the memory nodes that belong to the CPUs defined to be in the same cpuset\&.
A cpuset can have exclusive right to the CPUs defined in it. This means that only this cpuset can own these CPUs. Similarly, a cpuset can have exclusive right to the memory nodes defined in it. This means that only this cpuset can own these memory nodes.
A cpuset can have exclusive right to the CPUs defined in it\&. This means that only this cpuset can own these CPUs\&. Similarly, a cpuset can have exclusive right to the memory nodes defined in it\&. This means that only this cpuset can own these memory nodes\&.
Cpusets can be specified by name or by path; however, care should be taken when specifying by name if the name is not unique. This tool will generally not let you do destructive things to non\-unique cpuset names.
Cpusets can be specified by name or by path; however, care should be taken when specifying by name if the name is not unique\&. This tool will generally not let you do destructive things to non\-unique cpuset names\&.
Cpusets are uniquely specified by path. The path starts at where the cpusets filesystem is mounted so you generally do not have to know where that is. For example, so specify a cpuset that is called "two" which is a subset of "one" which in turn is a subset of the root cpuset, use the path "/one/two" regardless of where the cpusets filesystem is mounted.
Cpusets are uniquely specified by path\&. The path starts at where the cpusets filesystem is mounted so you generally do not have to know where that is\&. For example, so specify a cpuset that is called "two" which is a subset of "one" which in turn is a subset of the root cpuset, use the path "/one/two" regardless of where the cpusets filesystem is mounted\&.
When specifying CPUs, a so\-called CPUSPEC is used. The CPUSPEC will accept a comma\-separated list of CPUs and inclusive range specifications. For example, \-\-cpu=1,3,5\-7 will assign CPU1, CPU3, CPU5, CPU6, and CPU7 to the specified cpuset.
When specifying CPUs, a so\-called CPUSPEC is used\&. The CPUSPEC will accept a comma\-separated list of CPUs and inclusive range specifications\&. For example, \-\-cpu=1,3,5\-7 will assign CPU1, CPU3, CPU5, CPU6, and CPU7 to the specified cpuset\&.
Note that cpusets follow certain rules. For example, children can only include CPUs that the parents already have. If you do not follow those rules, the kernel cpuset subsystem will not let you create that cpuset. For example, if you create a cpuset that contains CPU3, and then attempt to create a child of that cpuset with a CPU other than 3, you will get an error, and the cpuset will not be active. The error is somewhat cryptic in that it is usually a "Permission denied" error.
Note that cpusets follow certain rules\&. For example, children can only include CPUs that the parents already have\&. If you do not follow those rules, the kernel cpuset subsystem will not let you create that cpuset\&. For example, if you create a cpuset that contains CPU3, and then attempt to create a child of that cpuset with a CPU other than 3, you will get an error, and the cpuset will not be active\&. The error is somewhat cryptic in that it is usually a "Permission denied" error\&.
Memory nodes are specified with a MEMSPEC in a similar way to the CPUSPEC. For example, \-\-mem=1,3\-6 will assign MEM1, MEM3, MEM4, MEM5, and MEM6 to the specified cpuset.
Memory nodes are specified with a MEMSPEC in a similar way to the CPUSPEC\&. For example, \-\-mem=1,3\-6 will assign MEM1, MEM3, MEM4, MEM5, and MEM6 to the specified cpuset\&.
Note that if you attempt to create or modify a cpuset with a memory node specification that is not valid, you may get a cryptic error message, "No space left on device", and the modification will not be allowed.
Note that if you attempt to create or modify a cpuset with a memory node specification that is not valid, you may get a cryptic error message, "No space left on device", and the modification will not be allowed\&.
When you destroy a cpuset, then the tasks running in that set are moved to the parent of that cpuset. If this is not what you want, then manually move those tasks to the cpuset of your choice with the \fIcset proc\fR command (see \fIcset proc \-\-help\fR for more information).
When you destroy a cpuset, then the tasks running in that set are moved to the parent of that cpuset\&. If this is not what you want, then manually move those tasks to the cpuset of your choice with the \fIcset proc\fR command (see \fIcset proc \-\-help\fR for more information)\&.
.SS"EXAMPLES"
.TP
.PP
Create a cpuset with the default memory specification
.RS4
\fB# cset set \-\-cpu=2,4,6\-8 \-\-set=new_set\fR
This command creates a cpuset called "new_set" located off the root cpuset which holds CPUS 2,4,6,7,8 and node 0 (interleaved) memory. Note that \-\-set is optional, and you can just specify the name for the new cpuset after all arguments.
.TP
.RE
This command creates a cpuset called "new_set" located off the root cpuset which holds CPUS 2,4,6,7,8 and node 0 (interleaved) memory\&. Note that \-\-set is optional, and you can just specify the name for the new cpuset after all arguments\&.
.PP
Create a cpuset that specifies both CPUs and memory nodes
.RS4
\fB# cset set \-\-cpu=3 \-\-mem=3 /rad/set_one\fR
.RE
Note that this command uses the full path method to specify the name of the new cpuset "/rad/set_one"\&. It also names the new cpuset implicitly (i\&.e\&. no \-\-set option, although you can use that if you want to)\&. If the "set_one" name is unique, you can subsequently refer to is just by that\&. Memory node 3 is assigned to this cpuset as well as CPU 3\&.
Note that this command uses the full path method to specify the name of the new cpuset "/rad/set_one". It also names the new cpuset implicitly (i.e. no \-\-set option, although you can use that if you want to). If the "set_one" name is unique, you can subsequently refer to is just by that. Memory node 3 is assigned to this cpuset as well as CPU 3.
The above commands will create the new cpusets, or if they already exist, they will modify them to the new specifications.
The above commands will create the new cpusets, or if they already exist, they will modify them to the new specifications\&.
.SH"LICENSE"
Cpuset is licensed under the GNU GPL V2 only.
Cpuset is licensed under the GNU GPL V2 only\&.
.SH"COPYRIGHT"
Copyright (c) 2008\-2009 Novell Inc.
Copyright (c) 2008\-2010 Novell Inc\&.
.SH"AUTHOR"
Written by Alex Tsariounov <alext@novell.com>.
Written by Alex Tsariounov <alext@novell\&.com>\&.
@ -26,154 +37,219 @@ cset\-shield \- cpuset supercommand which implements cpu shielding
\fIcset\fR shield \-\-shield bash
.fi
.SH"OPTIONS"
.TP
.PP
\-h, \-\-help
.RS4
prints the list of options for this command
.TP
.RE
.PP
\-c CPUSPEC, \-\-cpu=CPUSPEC
.RS4
modifies or initializes the shield cpusets
.TP
.RE
.PP
\-r, \-\-reset
.RS4
destroys the shield
.TP
.RE
.PP
\-e, \-\-exec
.RS4
executes args in the shield
.TP
.RE
.PP
\-\-user=USER
.RS4
use this USER for \-\-exec (id or name)
.TP
.RE
.PP
\-\-group=GROUP
.RS4
use this GROUP for \-\-exec (id or name)
.TP
.RE
.PP
\-s, \-\-shield
.RS4
shield PIDSPEC specified with \-p/\-\-pid of processes or threads
.TP
.RE
.PP
\-u, \-\-unshield
.RS4
remove PIDSPEC specified with \-p/\-\-pid of processes or threads from the shield, the tasks keep running in the unshielded cpuset
.TP
.RE
.PP
\-\-threads
.RS4
if specified, any processes found in the PIDSPEC to have multiple threads will automatically have all their threads added to the PIDSPEC (use to shield or unshield all related threads)
.TP
.RE
.PP
\-k on|off, \-\-kthread=on|off
.RS4
shield from unbound interrupt threads as well
.TP
.RE
.PP
\-f, \-\-force
.RS4
force operation, use with care
.TP
.RE
.PP
\-v, \-\-verbose
.RS4
prints more detailed output, additive
.TP
.RE
.PP
\-\-sysset=SYSSET
.RS4
optionally specify system cpuset name
.TP
.RE
.PP
\-\-userset=USERSET
.RS4
optionally specify user cpuset name
.RE
.SH"DESCRIPTION"
This is a supercommand that creates basic cpu shielding. The normal cset commands can of course be used to create this basic shield, but the shield command combines many such commands to create and manage a common type of cpu shielding setup.
This is a supercommand that creates basic cpu shielding\&. The normal cset commands can of course be used to create this basic shield, but the shield command combines many such commands to create and manage a common type of cpu shielding setup\&.
The concept of shielding implies at minimum three cpusets, for example: root, user and system. The root cpuset always exists in all implementations of cpusets and contains all available CPUs on the machine. The system cpuset is so named because normal system tasks are made to run on it. The user cpuset is so named because that is the "shielded" cpuset on which you would run your tasks of interest.
The concept of shielding implies at minimum three cpusets, for example: root, user and system\&. The root cpuset always exists in all implementations of cpusets and contains all available CPUs on the machine\&. The system cpuset is so named because normal system tasks are made to run on it\&. The user cpuset is so named because that is the "shielded" cpuset on which you would run your tasks of interest\&.
Usually, CPU zero would be in the system set and the rest of the CPUs would be in the user set. After creation of the cpusets, all processes running in the root cpuset are moved to the system cpuset. Thus any new processes or threads spawned from these processes will also run the system cpuset.
Usually, CPU zero would be in the system set and the rest of the CPUs would be in the user set\&. After creation of the cpusets, all processes running in the root cpuset are moved to the system cpuset\&. Thus any new processes or threads spawned from these processes will also run the system cpuset\&.
If the optional \-\-kthread=on option is given to the shield command, then all kernel threads (with exception of the per\-CPU bound interrupt kernel threads) are also moved to the system set.
If the optional \-\-kthread=on option is given to the shield command, then all kernel threads (with exception of the per\-CPU bound interrupt kernel threads) are also moved to the system set\&.
One executes processes on the shielded user cpuset with the \-\-exec subcommand or moves processes or threads to the shielded cpuset with the \-\-shield subcommand with a \-\-pid option.
One executes processes on the shielded user cpuset with the \-\-exec subcommand or moves processes or threads to the shielded cpuset with the \-\-shield subcommand with a \-\-pid option\&.
.ifn\{\
.sp
.\}
.RS4
.it1an-trap
.nran-no-space-flag1
.nran-break-flag1
.br
.ps+1
\fBNote\fR
You do not need to specify which cpuset a process or thread is running in initially when using the \-\-shield subcommand.
To create a shield, you would execute the shield command with the \-\-cpu option that specifies CPUSPEC argument that assigns CPUs to be under the shield (this means assigned to the user cpuset, all other cpus will be assigned to the system set).
.ps-1
.br
You do not need to specify which cpuset a process or thread is running in initially when using the \-\-shield subcommand\&.
.sp.5v
.RE
To create a shield, you would execute the shield command with the \-\-cpu option that specifies CPUSPEC argument that assigns CPUs to be under the shield (this means assigned to the user cpuset, all other cpus will be assigned to the system set)\&.
For example:
\fB# cset shield \-\-cpu=1\-3\fR
On a 4\-way machine, this command will dedicate the first processor, CPU0, for the system set (unshielded) and the last three processors, CPU1, CPU2, CPU3, for the user set (shielded).
On a 4\-way machine, this command will dedicate the first processor, CPU0, for the system set (unshielded) and the last three processors, CPU1, CPU2, CPU3, for the user set (shielded)\&.
The CPUSPEC will accept a comma separated list of CPUs and inclusive range specifications. For example, \-\-cpu=1,3,5\-7 will assign CPU1, CPU3, CPU5, CPU6, and CPU7 to the user (or shielded) cpuset and the inverse of that to the system (or unshielded) cpuset.
The CPUSPEC will accept a comma separated list of CPUs and inclusive range specifications\&. For example, \-\-cpu=1,3,5\-7 will assign CPU1, CPU3, CPU5, CPU6, and CPU7 to the user (or shielded) cpuset and the inverse of that to the system (or unshielded) cpuset\&.
If you do not like the names "system" and "user" for the unshielded and shielded sets respectively, or if those names are used already, then use the \-\-sysset and \-\-userset options.
If you do not like the names "system" and "user" for the unshielded and shielded sets respectively, or if those names are used already, then use the \-\-sysset and \-\-userset options\&.
The above command will use the name "free" for the unshielded system cpuset, the name "cage" for the shielded user cpuset, initialize these cpusets and dedicate CPU0 and CPU1 to the "free" set and (on a 4\-way machine) dedicate CPU2 and CPU3 to the "cage" set. Further, the command moves all processes and threads, including kernel threads from the root cpuset to the "free" cpuset.
The above command will use the name "free" for the unshielded system cpuset, the name "cage" for the shielded user cpuset, initialize these cpusets and dedicate CPU0 and CPU1 to the "free" set and (on a 4\-way machine) dedicate CPU2 and CPU3 to the "cage" set\&. Further, the command moves all processes and threads, including kernel threads from the root cpuset to the "free" cpuset\&.
.ifn\{\
.sp
.\}
.RS4
.it1an-trap
.nran-no-space-flag1
.nran-break-flag1
.br
.ps+1
\fBNote\fR
If you do use the \-\-syset/\-\-userset options, then you must continue to use those for every invocation of the shield supercommand.
After initialization, you can run the process of interest on the shielded cpuset with the \-\-exec subcommand, or move processes or threads already running to the shielded cpuset with the \-\-shield subcommand and the \-\-pid option.
.ps-1
.br
If you do use the \-\-syset/\-\-userset options, then you must continue to use those for every invocation of the shield supercommand\&.
.sp.5v
.RE
After initialization, you can run the process of interest on the shielded cpuset with the \-\-exec subcommand, or move processes or threads already running to the shielded cpuset with the \-\-shield subcommand and the \-\-pid option\&.
Note that if your execed command takes options, then use the traditional "\-\-" marker to separate cset\(cqs options from your command\(cqs options.
Note that if your execed command takes options, then use the traditional "\-\-" marker to separate cset\(cqs options from your command\(cqs options\&.
For example:
\fB# cset shield \-\-exec \(em ls \-l\fR
This command will execute "ls \-l" inside the shield.
This command will execute "ls \-l" inside the shield\&.
The PIDSPEC argument taken for the \-\-pid (or \-p) option is a comma separated list of PIDs or TIDs. The list can also include brackets of PIDs or TIDs that are inclusive of the endpoints.
The PIDSPEC argument taken for the \-\-pid (or \-p) option is a comma separated list of PIDs or TIDs\&. The list can also include brackets of PIDs or TIDs that are inclusive of the endpoints\&.
For example:
.sp
.ifn\{\
.RS4
.\}
.nf
1,2,5 Means processes 1, 2 and 5
1,2,600\-700 Means processes 1, 2 and from 600 to 700
.fi
.ifn\{\
.RE
.\}
.sp
\fB# cset shield \-\-shield \-\-pid=50\-65\fR
The above command moves all processes and threads with PID or TID in the range 50\-65 inclusive, from the system cpuset into the shielded user cpuset. If they are running in the root cpuset, you must use the \-\-force option to actually move them into the shield.
The above command moves all processes and threads with PID or TID in the range 50\-65 inclusive, from the system cpuset into the shielded user cpuset\&. If they are running in the root cpuset, you must use the \-\-force option to actually move them into the shield\&.
.ifn\{\
.sp
.\}
.RS4
.it1an-trap
.nran-no-space-flag1
.nran-break-flag1
.br
.ps+1
\fBNote\fR
The range of PIDs or TIDs does not need to have every position populated. In other words, for the example above, if there is only one process, say PID 57, in the range of 50\-65, then only that process will be moved.
The \-\-unshield (or \-u) subcommand will remove the specified processes or threads from the shielded cpuset and move them into the unshielded (or system) cpuset. This command is also used in conjuction with a \-p/\-\-pid option that specifies a PIDSPEC argument, the same as for the \-\-shield subcommand.
.ps-1
.br
The range of PIDs or TIDs does not need to have every position populated\&. In other words, for the example above, if there is only one process, say PID 57, in the range of 50\-65, then only that process will be moved\&.
.sp.5v
.RE
The \-\-unshield (or \-u) subcommand will remove the specified processes or threads from the shielded cpuset and move them into the unshielded (or system) cpuset\&. This command is also used in conjuction with a \-p/\-\-pid option that specifies a PIDSPEC argument, the same as for the \-\-shield subcommand\&.
Both the \-\-shield and the \-\-unshield commands will also finally output the number of tasks running in the shield and out of the shield if you do not specify a PIDSPEC with \-\-pid. By specifying also a \-\-verbose in addition, then you will get a listing of every task that is running in either the shield or out of the shield.
Both the \-\-shield and the \-\-unshield commands will also finally output the number of tasks running in the shield and out of the shield if you do not specify a PIDSPEC with \-\-pid\&. By specifying also a \-\-verbose in addition, then you will get a listing of every task that is running in either the shield or out of the shield\&.
Using no subcommand, ie. only "cset shield", will output the status of both shield and non\-shield. Tasks will be listed if \-\-verbose is used.
Using no subcommand, ie\&. only "cset shield", will output the status of both shield and non\-shield\&. Tasks will be listed if \-\-verbose is used\&.
You can adjust which CPUs are in the shielded cpuset by issuing the \-\-cpu subcommand again anytime after the shield has been initialized.
You can adjust which CPUs are in the shielded cpuset by issuing the \-\-cpu subcommand again anytime after the shield has been initialized\&.
For example if the original shield contained CPU0 and CPU1 in the system set and CPU2 and CPU3 in the user set, if you then issue the following command:
\fB# cset shield \-\-cpu=1,2,3\fR
then that command will move CPU1 into the shielded "user" cpuset. Any processes or threads that were running on CPU1 that belonged to the unshielded "system" cpuset are migrated to CPU0 by the system.
then that command will move CPU1 into the shielded "user" cpuset\&. Any processes or threads that were running on CPU1 that belonged to the unshielded "system" cpuset are migrated to CPU0 by the system\&.
The \-\-reset subcommand will in essence destroy the shield. For example, if there was a shield on a 4\-way machine with CPU0 in system and CPUs 1\-3 in user with processes running on the user cpuset (i.e. in the shield), and a \-\-reset subcommand was issued, then all processes running in both system and user cpusets would be migrated to the root cpuset (which has access to all CPUs and never goes away), after which both system and user cpusets would be destroyed.
The \-\-reset subcommand will in essence destroy the shield\&. For example, if there was a shield on a 4\-way machine with CPU0 in system and CPUs 1\-3 in user with processes running on the user cpuset (i\&.e\&. in the shield), and a \-\-reset subcommand was issued, then all processes running in both system and user cpusets would be migrated to the root cpuset (which has access to all CPUs and never goes away), after which both system and user cpusets would be destroyed\&.
.ifn\{\
.sp
.\}
.RS4
.it1an-trap
.nran-no-space-flag1
.nran-break-flag1
.br
.ps+1
\fBNote\fR
Even though you can mix general usage of cpusets with the shielding concepts described here, you generally will not want to. For more complex shielding or usage scenarios, one would generally use the normal cpuset commands (i.e. cset set and proc) directly.
.ps-1
.br
Even though you can mix general usage of cpusets with the shielding concepts described here, you generally will not want to\&. For more complex shielding or usage scenarios, one would generally use the normal cpuset commands (i\&.e\&. cset set and proc) directly\&.
.sp.5v
.RE
.SH"LICENSE"
Cpuset is licensed under the GNU GPL V2 only.
Cpuset is licensed under the GNU GPL V2 only\&.
.SH"COPYRIGHT"
Copyright (c) 2008\-2009 Novell Inc.
Copyright (c) 2008\-2010 Novell Inc\&.
.SH"AUTHOR"
Written by Alex Tsariounov <alext@novell.com>.
Written by Alex Tsariounov <alext@novell\&.com>\&.