DESCRIPTION

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.

Use -- before command if using command options that could be confused

with numactl options.

Policy settings are:

--interleave=nodes, -i nodes

Set a memory interleave policy. Memory will be allocated using round robin
on
nodes.
When memory cannot be allocated on the current interleave target fall back
to other nodes.
Multiple nodes may be specified on --interleave, --membind and --cpunodebind.
You may specify "all", which means all nodes in the current cpuset.
nodes
may be specified as N,N,N or N-N or N,N-N or N-N,N-N and so forth.
Relative
nodes
may be specifed as +N,N,N or +N-N or +N,N-N and so forth. The + indicates that
the node numbers are relative to the process' set of allowed nodes in its
current cpuset.
A !N-N notation indicates the inverse of N-N, in other words all nodes
except N-N. If used with + notation, specify !+N-N.

--membind=nodes, -m nodes

Only allocate memory from nodes. Allocation will fail when there
is not enough memory available on these nodes.
nodes
may be specified as noted above.

--cpunodebind=nodes, -N nodes

Only execute
command
on the CPUs of
nodes.
Note that nodes may consist of multiple CPUs.
nodes
may be specified as noted above.

--physcpubind=cpus, -C cpus

Only execute
process
on
cpus.
This accepts cpu numbers as shown in the
processor
fields of
/proc/cpuinfo,
or relative cpus as in relative to the current cpuset.
You may specify "all", which means all cpus in the current cpuset.
Physical
cpus
may be specified as N,N,N or N-N or N,N-N or N-N,N-N and so forth.
Relative
cpus
may be specifed as +N,N,N or +N-N or +N,N-N and so forth. The + indicates that
the cpu numbers are relative to the process' set of allowed cpus in its
current cpuset.
A !N-N notation indicates the inverse of N-N, in other words all cpus
except N-N. If used with + notation, specify !+N-N.

--localalloc, -l

Always allocate on the current node.

--preferred=node

Preferably allocate memory on
node,
but if memory cannot be allocated there fall back to other nodes.
This option takes only a single node number.
Relative notation may be used.

--show, -s

Show NUMA policy settings of the current process.

--hardware, -H

Show inventory of available nodes on the system.

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
--shm, --shmid, --file
to specify the shared memory segment or file and a memory policy like described
above (
--interleave, --localalloc, --preferred,--membind
).

--huge

When creating a SYSV shared memory segment use huge pages.
Only valid before --shmid or --shm

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.

--shmmode shmmode

Only valid before --shmid or --shm
When creating a shared memory segment set it to numeric mode
shmmode.

--length length

Apply policy to
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
m
(for MB),
g
(for GB),
k
(for KB),
otherwise it specifies bytes.

--shmid id

Create or use an shared memory segment with numeric ID
id

--shm shmkeyfile

Create or use an shared memory segment, with the ID generated
using
ftok(3)
from shmkeyfile

--file tmpfsfile

Set policy for a file in tmpfs or hugetlbfs

--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.

--dump

Dump policy in the specified range.

--dump-nodes

Dump all nodes of the specific range (very verbose!)

Valid node specifiers

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.

EXAMPLES

numactl --physcpubind=+0-4,8-12 myapplic arguments
Run myapplic on cpus 0-4 and 8-12 of the current cpuset.

numactl --interleave=all bigdatabase arguments
Run big database with its memory interleaved on all CPUs.