Main index | Section 1 | Options |
cpuset
requires a target to modify or query.
The target may be specified as a command, process id, thread id, a
cpuset id, an irq, a jail, or a NUMA domain.
Using
There are two sets applicable to each process and one private mask per thread.
Every process in the system belongs to a cpuset.
By default processes are started in set 1.
The mask or id may be queried using
Most sets include NUMA memory domain and policy information.
This can be inspected with
When running a command it may join a set specified with
The options are as follows:
| Create a new cpuset and assign the target process to that set. |
| The requested operation should reference the cpuset available via the target specifier. |
| |
Specifies a NUMA domain id as the target of the operation. This can only be used to query the cpus visible in each numberd domain. | |
|
Causes
cpuset
to print either a list of valid CPUs or, using
|
|
When used with the
|
| |
Specifies a jail id or name as the target of the operation. | |
| |
Specifies a list of CPUs to apply to a target. Specification may include numbers separated by '-' for ranges and commas separating individual numbers. A special list of "all" may be specified in which case the list includes all CPUs from the root set. | |
| |
Specifies a list of domains and allocation policy to apply to a target.
Ranges may be specified as in
| |
| Specifies a pid as the target of the operation. |
| |
Specifies a set id as the target of the operation. | |
| The requested operation should reference the root set available via the target specifier. |
| Specifies a thread id as the target of the operation. |
| Specifies an irq as the target of the operation. |
cpuset -c -l 0-4 /bin/sh
Query the mask of CPUs the <sh pid> is allowed to run on:
cpuset -g -p <sh pid>
Restrict /bin/sh to run on CPUs 0 and 2 while its group is still allowed to run on CPUs 0-4:
cpuset -l 0,2 -p <sh pid>
Modify the cpuset /bin/sh belongs to restricting it to CPUs 0 and 2:
cpuset -l 0,2 -c -p <sh pid>
Modify the cpuset all threads are in by default to contain only the first 4 CPUs, leaving the rest idle:
cpuset -l 0-3 -s 1
Print the id of the cpuset /bin/sh is in:
cpuset -g -i -p <sh pid>
Move the pid into the specified cpuset setid so it may be managed with other pids in that set:
cpuset -s <setid> -p <pid>
Create a new cpuset that is restricted to CPUs 0 and 2 and move pid into the new set:
cpuset -C -c -l 0,2 -p <pid>
CPUSET (1) | July 3, 2018 |
Main index | Section 1 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | Not only is UNIX dead, it's starting to smell really bad. | ” |
— Rob Pike |