forked from numactl/numactl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnumactl.8
224 lines (214 loc) · 4.99 KB
/
numactl.8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
.\" t
.TH NUMACTL 8 "Mar 2004" "SuSE Labs" "Linux Administrator's Manual"
.SH NAME
numactl \- Control NUMA policy for processes or shared memory
.SH SYNOPSIS
.B numactl
[
.B \-\-interleave nodes
] [
.B \-\-preferred node
] [
.B \-\-membind nodes
] [
.B \-\-cpubind nodes
] [
.B \-\-localalloc
] command {arguments ...}
.br
.B numactl \-\-show
.br
.B numactl \-\-hardware
.br
.B numactl
[
.B \-\-huge
] [
.B \-\-offset offset
] [
.B \-\-mode shmmode
] [
.B \-\-length length
] [
.B \-\-strict
]
.br
.B \-\-shmid id
|
.B \-\-shm shmkeyfile
|
.B \-\-file tmpfsfile
.br
[
.B \-\-touch
] [
.B \-\-dump
]
memory policy
.SH DESCRIPTION
.B numactl
runs processes with a specific NUMA scheduling or memory placement policy.
The policy is set for command and inherited by all of its children.
In addition it can set persistent policy for shared memory segments or files.
.TP
Policy settings are:
.TP
.B \-\-interleave=nodes, \-i nodes
Set an memory interleave policy. Memory will be allocated using round robin
on
.I nodes.
When memory cannot be allocated on the current interleave target fall back
to other nodes.
.TP
.B \-\-membind=nodes, \-m nodes
Only allocate memory from nodes. Allocation will fail when there
is not enough memory available on these nodes.
.TP
.B \-\-cpubind=nodes, \-c nodes
Only execute process on the CPUs of
.I nodes.
.TP
.B \-\-localalloc, \-l
Do always local allocation on the current node.
.TP
.B \-\-preferred=node
Preferably allocate memory on
.I node,
but if memory cannot be allocated there fall back to other nodes.
This option takes only a single node number.
.TP
.B \-\-show, \-s
Show NUMA policy settings of the current process.
.TP
.B \-\-hardware, \-H
Show inventory of available nodes on the system.
.TP 0
Numactl can set up policy for a SYSV shared memory segment or a file in shmfs/hugetlbfs.
This policy is persistent and will be used by
all mappings from that shared memory. The order of options matters here.
The specification must at least include either of
.I \-\-shm,
.I \-\-shmid,
.I \-\-file
to specify the shared memory segment or file and a memory policy like described
above (
.I \-\-interleave,
.I \-\-localalloc,
.I \-\-prefered,
.I \-\-membind
).
.TP
.B \-\-huge
When creating a SYSV shared memory segment use huge pages.
Only valid before \-\-shmid or \-\-shm
.TP
.B \-\-offset
Specify offset into the shared memory segment. Default 0.
Valid units are
.I m
(for MB),
.I g
(for GB),
.I k
(for KB),
otherwise it specifies bytes.
.TP
.B \-\-strict
Give an error when a page in the policied area in the shared memory
segment already was faulted in with a conflicting policy. Default
is to silently ignore this.
.TP
.B \-\-mode shmmode
Only valid before \-\-shmid or \-\-shm
When creating a shared memory segment set it to numeric mode
.I shmmode.
.TP
.B \-\-length length
Apply policy to
.I length
range in the shared memory segment or make
the segment length long
Default is to use the remaining length
Required when a shared memory segment is created and specifies the length
of the new segment then. Valid units are
.I m
(for MB),
.I g
(for GB),
.I k
(for KB),
otherwise it specifies bytes.
.TP
.B \-\-shmid id
Create or use an shared memory segment with numeric ID
.I id
.TP
.B \-\-shm shmkeyfile
Create or use an shared memory segment, with the ID generated
using
.I ftok(3)
from shmkeyfile
.TP
.B \-\-file tmpfsfile
Set policy for a file in tmpfs or hugetlbfs
.TP
.B \-\-touch
Touch pages to enforce policy early. Default is to not touch them, the policy
is applied when an applications maps and accesses a page.
.TP
.B \-\-dump
Dump policy in the specified range.
.TP
Valid node specifiers
.TS
tab(:);
l l.
all:All nodes
number:Node number
number1{,number2}:Node number1 and Node number2
number1-number2:Nodes from number1 to number2
! nodes:Invert selection of the following specification.
.TE
.SH EXAMPLES
numactl \-\-interleave=all bigdatabase arguments
Run big database with its memory interleaved on all CPUs.
numactl \-\-cpubind=0 \-\-membind=0,1 process
Run process on node 0 with memory allocated on node 0 and 1.
numactl \-\-preferred=1 numactl \-\-show
Set preferred node 1 and show the resulting state.
numactl --interleave=all --shmkeyfile /tmp/shmkey
Interleave all of the sysv shared memory regiion specified by
/tmp/shmkey over all nodes.
numactl --offset=1G --length=1G --membind=1 --file /hugetlbfs/A --touch
Bind the second gigabyte in the hugetlbfs file /hugetlbfs/A to node 1.
numactl --localalloc /shmfs/file
Reset the policy for the shared memory file
.I file
to the default localalloc policy.
.SH NOTES
Requires an NUMA policy aware kernel.
Command is not executed using a shell. If you want to use shell metacharacters
in the child use sh -c as wrapper.
.SH FILES
.I /proc/cpuinfo
for the listing of active CPUs. See
.I proc(5)
for details.
.I /sys/devices/system/node/node*/numastat
for NUMA memory hit statistics.
.SH SEE ALSO
.I set_mempolicy(2)
,
.I get_mempolicy(2)
,
.I mbind(2)
,
.I sched_setaffinity(2)
,
.I sched_getaffinity(2)
,
.I proc(5)
,
.I ftok(3)
,
.I shmat(2)