xref: /freebsd/share/man/man4/numa.4 (revision 07d397d74651435ff6f4d474876589e85967350e)
1.\" Copyright (c) 2015 Adrian Chadd <adrian@FreeBSD.org>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd July 10, 2018
28.Dt NUMA 4
29.Os
30.Sh NAME
31.Nm NUMA
32.Nd Non-Uniform Memory Access
33.Sh SYNOPSIS
34.Cd options SMP
35.Cd options MAXMEMDOM=16
36.Pp
37.In sys/cpuset.h
38.In sys/bus.h
39.Sh DESCRIPTION
40Non-Uniform Memory Access is a computer architecture design which
41involves unequal costs between processors, memory and IO devices
42in a given system.
43.Pp
44In a
45.Nm
46architecture, the latency to access specific memory or IO devices
47depends upon which processor the memory or device is attached to.
48Accessing memory local to a processor is faster than accessing memory
49that is connected to one of the other processors.
50.Pp
51.Nm
52is enabled when the
53.Cd NUMA
54option is used in a kernel configuration
55file and the
56.Cd MAXMEMDOM
57option is set to a value greater than 1.
58.Pp
59Thread and process
60.Nm
61policies are controlled with the
62.Xr cpuset_getdomain 2
63and
64.Xr cpuset_setdomain 2
65syscalls.
66The
67.Xr cpuset 1
68tool is available for starting processes with a non-default
69policy, or to change the policy of an existing thread or process.
70.Pp
71Systems with non-uniform access to I/O devices may mark those devices
72with the local VM domain identifier.
73Drivers can find out their local domain information by calling
74.Xr bus_get_domain 9 .
75.Ss MIB Variables
76The operation of
77.Nm
78is controlled and exposes information with these
79.Xr sysctl 8
80MIB variables:
81.Pp
82.Bl -tag -width indent -compact
83.It Va vm.ndomains
84The number of VM domains which have been detected.
85.Pp
86.It Va vm.phys_locality
87A table indicating the relative cost of each VM domain to each other.
88A value of 10 indicates equal cost.
89A value of -1 means the locality map is not available or no
90locality information is available.
91.Pp
92.It Va vm.phys_segs
93The map of physical memory, grouped by VM domain.
94.El
95.Sh IMPLEMENTATION NOTES
96The current
97.Nm
98implementation is VM-focused.
99The hardware
100.Nm
101domains are mapped into a contiguous, non-sparse
102VM domain space, starting from 0.
103Thus, VM domain information (for example, the domain identifier) is not
104necessarily the same as is found in the hardware specific information.
105Policy information is available in both struct thread and struct proc.
106.Sh SEE ALSO
107.Xr cpuset 1 ,
108.Xr cpuset_getaffinity 2 ,
109.Xr cpuset_setaffinity 2 ,
110.Xr bus_get_domain 9
111.Sh HISTORY
112.Nm
113first appeared in
114.Fx 9.0
115as a first-touch allocation policy with a fail-over to round-robin allocation
116and was not configurable.
117It was then modified in
118.Fx 10.0
119to implement a round-robin allocation policy and was also not configurable.
120.Pp
121The
122.Xr numa_getaffinity 2
123and
124.Xr numa_setaffinity 2
125syscalls and the
126.Xr numactl 1
127tool first appeared in
128.Fx 11.0
129and were removed in
130.Fx 12.0 .
131Current implementation appeared in
132.Fx 12.0 .
133.Pp
134.Sh AUTHORS
135This manual page written by
136.An Adrian Chadd Aq Mt adrian@FreeBSD.org .
137.Sh NOTES
138No statistics are kept to indicate how often
139.Nm
140allocation policies succeed or fail.
141