]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/cpuset/cpuset.1
Fix improper checking in SCTP-AUTH shared key update.
[FreeBSD/FreeBSD.git] / usr.bin / cpuset / cpuset.1
1 .\" Copyright (c) 2008 Christian Brueffer
2 .\" Copyright (c) 2008 Jeffrey Roberson
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $FreeBSD$
27 .\"
28 .Dd July 3, 2018
29 .Dt CPUSET 1
30 .Os
31 .Sh NAME
32 .Nm cpuset
33 .Nd "configure processor sets"
34 .Sh SYNOPSIS
35 .Nm
36 .Op Fl l Ar cpu-list
37 .Op Fl s Ar setid
38 .Ar cmd ...
39 .Nm
40 .Op Fl l Ar cpu-list
41 .Op Fl s Ar setid
42 .Fl p Ar pid
43 .Nm
44 .Op Fl c
45 .Op Fl l Ar cpu-list
46 .Fl C
47 .Fl p Ar pid
48 .Nm
49 .Op Fl c
50 .Op Fl l Ar cpu-list
51 .Op Fl j Ar jail | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq
52 .Nm
53 .Fl g
54 .Op Fl cir
55 .Op Fl d Ar domain | Fl j Ar jail | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq
56 .Sh DESCRIPTION
57 The
58 .Nm
59 command can be used to assign processor sets to processes, run commands
60 constrained to a given set or list of processors, and query information
61 about processor binding, sets, and available processors in the system.
62 .Pp
63 .Nm
64 requires a target to modify or query.
65 The target may be specified as a command, process id, thread id, a
66 cpuset id, an irq, a jail, or a NUMA domain.
67 Using
68 .Fl g
69 the target's set id or mask may be queried.
70 Using
71 .Fl l
72 or
73 .Fl s
74 the target's CPU mask or set id may be set.
75 If no target is specified,
76 .Nm
77 operates on itself.
78 Not all combinations of operations and targets are supported.
79 For example,
80 you may not set the id of an existing set or query and launch a command
81 at the same time.
82 .Pp
83 There are two sets applicable to each process and one private mask per thread.
84 Every process in the system belongs to a cpuset.
85 By default processes are started in set 1.
86 The mask or id may be queried using
87 .Fl c .
88 Each thread also has a private mask of CPUs it is allowed to run
89 on that must be a subset of the assigned set.
90 And finally, there is a root set, numbered 0, that is immutable.
91 This last set is the list of all possible CPUs in the system and is
92 queried using
93 .Fl r .
94 .Pp
95 When running a command it may join a set specified with
96 .Fl s
97 otherwise a new set is created.
98 In addition, a mask for the command may be specified using
99 .Fl l .
100 When used in conjunction with
101 .Fl c
102 the mask modifies the supplied or created set rather than the private mask
103 for the thread.
104 .Pp
105 The options are as follows:
106 .Bl -tag -width ".Fl l Ar cpu-list"
107 .It Fl C
108 Create a new cpuset and assign the target process to that set.
109 .It Fl c
110 The requested operation should reference the cpuset available via the
111 target specifier.
112 .It Fl d Ar domain
113 Specifies a NUMA domain id as the target of the operation.
114 .It Fl g
115 Causes
116 .Nm
117 to print either a list of valid CPUs or, using
118 .Fl i ,
119 the id of the target.
120 .It Fl i
121 When used with the
122 .Fl g
123 option print the id rather than the valid mask of the target.
124 .It Fl j Ar jail
125 Specifies a jail id or name as the target of the operation.
126 .It Fl l Ar cpu-list
127 Specifies a list of CPUs to apply to a target.
128 Specification may include
129 numbers separated by '-' for ranges and commas separating individual numbers.
130 A special list of
131 .Dq all
132 may be specified in which case the list includes all CPUs from the root set.
133 .It Fl p Ar pid
134 Specifies a pid as the target of the operation.
135 .It Fl s Ar setid
136 Specifies a set id as the target of the operation.
137 .It Fl r
138 The requested operation should reference the root set available via the
139 target specifier.
140 .It Fl t Ar tid
141 Specifies a thread id as the target of the operation.
142 .It Fl x Ar irq
143 Specifies an irq as the target of the operation.
144 .El
145 .Sh EXIT STATUS
146 .Ex -std
147 .Sh EXAMPLES
148 Create a new group with CPUs 0-4 inclusive and run
149 .Pa /bin/sh
150 on it:
151 .Dl cpuset -c -l 0-4 /bin/sh
152 .Pp
153 Query the mask of CPUs the
154 .Aq sh pid
155 is allowed to run on:
156 .Dl cpuset -g -p <sh pid>
157 .Pp
158 Restrict
159 .Pa /bin/sh
160 to run on CPUs 0 and 2 while its group is still allowed to run on
161 CPUs 0-4:
162 .Dl cpuset -l 0,2 -p <sh pid>
163 .Pp
164 Modify the cpuset
165 .Pa /bin/sh
166 belongs to restricting it to CPUs 0 and 2:
167 .Dl cpuset -l 0,2 -c -p <sh pid>
168 .Pp
169 Modify the cpuset all threads are in by default to contain only
170 the first 4 CPUs, leaving the rest idle:
171 .Dl cpuset -l 0-3 -s 1
172 .Pp
173 Print the id of the cpuset
174 .Pa /bin/sh
175 is in:
176 .Dl cpuset -g -i -p <sh pid>
177 .Pp
178 Move the
179 .Ar pid
180 into the specified cpuset
181 .Ar setid
182 so it may be managed with other pids in that set:
183 .Dl cpuset -s <setid> -p <pid>
184 .Pp
185 Create a new cpuset that is restricted to CPUs 0 and 2 and move
186 .Ar pid
187 into the new set:
188 .Dl cpuset -C -c -l 0,2 -p <pid>
189 .Sh SEE ALSO
190 .Xr cpuset 2 ,
191 .Xr rctl 8
192 .Sh HISTORY
193 The
194 .Nm
195 command first appeared in
196 .Fx 7.1 .
197 .Sh AUTHORS
198 .An Jeffrey Roberson Aq Mt jeff@FreeBSD.org