xref: /freebsd/share/man/man4/numa.4 (revision b61f31429050a1769cd01ca74a6136691f81eebb)
16520495aSAdrian Chadd.\" Copyright (c) 2015 Adrian Chadd <adrian@FreeBSD.org>
26520495aSAdrian Chadd.\" All rights reserved.
36520495aSAdrian Chadd.\"
46520495aSAdrian Chadd.\" Redistribution and use in source and binary forms, with or without
56520495aSAdrian Chadd.\" modification, are permitted provided that the following conditions
66520495aSAdrian Chadd.\" are met:
76520495aSAdrian Chadd.\" 1. Redistributions of source code must retain the above copyright
86520495aSAdrian Chadd.\"    notice, this list of conditions and the following disclaimer.
96520495aSAdrian Chadd.\" 2. Redistributions in binary form must reproduce the above copyright
106520495aSAdrian Chadd.\"    notice, this list of conditions and the following disclaimer in the
116520495aSAdrian Chadd.\"    documentation and/or other materials provided with the distribution.
126520495aSAdrian Chadd.\"
136520495aSAdrian Chadd.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
146520495aSAdrian Chadd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
156520495aSAdrian Chadd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
166520495aSAdrian Chadd.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
176520495aSAdrian Chadd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
186520495aSAdrian Chadd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
196520495aSAdrian Chadd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
206520495aSAdrian Chadd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
216520495aSAdrian Chadd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
226520495aSAdrian Chadd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
236520495aSAdrian Chadd.\" SUCH DAMAGE.
246520495aSAdrian Chadd.\"
256520495aSAdrian Chadd.\" $FreeBSD$
266520495aSAdrian Chadd.\"
27*b61f3142SMark Johnston.Dd October 22, 2018
286520495aSAdrian Chadd.Dt NUMA 4
296520495aSAdrian Chadd.Os
306520495aSAdrian Chadd.Sh NAME
316520495aSAdrian Chadd.Nm NUMA
326520495aSAdrian Chadd.Nd Non-Uniform Memory Access
336520495aSAdrian Chadd.Sh SYNOPSIS
34*b61f3142SMark Johnston.Cd options MAXMEMDOM
35*b61f3142SMark Johnston.Cd options NUMA
366520495aSAdrian Chadd.Pp
376520495aSAdrian Chadd.Sh DESCRIPTION
386520495aSAdrian ChaddNon-Uniform Memory Access is a computer architecture design which
396520495aSAdrian Chaddinvolves unequal costs between processors, memory and IO devices
406520495aSAdrian Chaddin a given system.
416520495aSAdrian Chadd.Pp
426520495aSAdrian ChaddIn a
436520495aSAdrian Chadd.Nm
446520495aSAdrian Chaddarchitecture, the latency to access specific memory or IO devices
456520495aSAdrian Chadddepends upon which processor the memory or device is attached to.
466520495aSAdrian ChaddAccessing memory local to a processor is faster than accessing memory
476520495aSAdrian Chaddthat is connected to one of the other processors.
48*b61f3142SMark Johnston.Fx
49*b61f3142SMark Johnstonimplements NUMA-aware memory allocation policies.
50*b61f3142SMark JohnstonBy default it attempts to ensure that allocations are balanced across
51*b61f3142SMark Johnstoneach domain.
52*b61f3142SMark JohnstonUsers may override the default domain selection policy using
53*b61f3142SMark Johnston.Xr cpuset 1 .
546520495aSAdrian Chadd.Pp
556520495aSAdrian Chadd.Nm
56*b61f3142SMark Johnstonsupport is enabled when the
57b3042426SKonstantin Belousov.Cd NUMA
58*b61f3142SMark Johnstonoption is specified in the kernel configuration file.
59*b61f3142SMark JohnstonEach platform defines the
60b3042426SKonstantin Belousov.Cd MAXMEMDOM
61*b61f3142SMark Johnstonconstant, which specifies the maximum number of supported NUMA domains.
62*b61f3142SMark JohnstonThis constant may be specified in the kernel configuration file.
63*b61f3142SMark Johnston.Nm
64*b61f3142SMark Johnstonsupport can be disabled at boot time by setting the
65*b61f3142SMark Johnston.Va vm.numa.disabled
66*b61f3142SMark Johnstontunable to 1.
67*b61f3142SMark JohnstonOther values for this tunable are currently ignored.
686520495aSAdrian Chadd.Pp
696520495aSAdrian ChaddThread and process
706520495aSAdrian Chadd.Nm
716520495aSAdrian Chaddpolicies are controlled with the
72b3042426SKonstantin Belousov.Xr cpuset_getdomain 2
736520495aSAdrian Chaddand
74b3042426SKonstantin Belousov.Xr cpuset_setdomain 2
756520495aSAdrian Chaddsyscalls.
766520495aSAdrian ChaddThe
77b3042426SKonstantin Belousov.Xr cpuset 1
786520495aSAdrian Chaddtool is available for starting processes with a non-default
796520495aSAdrian Chaddpolicy, or to change the policy of an existing thread or process.
806520495aSAdrian Chadd.Pp
816520495aSAdrian ChaddSystems with non-uniform access to I/O devices may mark those devices
826520495aSAdrian Chaddwith the local VM domain identifier.
836520495aSAdrian ChaddDrivers can find out their local domain information by calling
846520495aSAdrian Chadd.Xr bus_get_domain 9 .
856520495aSAdrian Chadd.Ss MIB Variables
866520495aSAdrian ChaddThe operation of
876520495aSAdrian Chadd.Nm
886520495aSAdrian Chaddis controlled and exposes information with these
896520495aSAdrian Chadd.Xr sysctl 8
906520495aSAdrian ChaddMIB variables:
916520495aSAdrian Chadd.Pp
926520495aSAdrian Chadd.Bl -tag -width indent -compact
936520495aSAdrian Chadd.It Va vm.ndomains
946520495aSAdrian ChaddThe number of VM domains which have been detected.
956520495aSAdrian Chadd.Pp
966520495aSAdrian Chadd.It Va vm.phys_locality
976520495aSAdrian ChaddA table indicating the relative cost of each VM domain to each other.
986520495aSAdrian ChaddA value of 10 indicates equal cost.
996520495aSAdrian ChaddA value of -1 means the locality map is not available or no
1006520495aSAdrian Chaddlocality information is available.
1016520495aSAdrian Chadd.Pp
1026520495aSAdrian Chadd.It Va vm.phys_segs
1036520495aSAdrian ChaddThe map of physical memory, grouped by VM domain.
1046520495aSAdrian Chadd.El
1056520495aSAdrian Chadd.Sh IMPLEMENTATION NOTES
1066520495aSAdrian ChaddThe current
1076520495aSAdrian Chadd.Nm
1086520495aSAdrian Chaddimplementation is VM-focused.
1096520495aSAdrian ChaddThe hardware
1106520495aSAdrian Chadd.Nm
1116520495aSAdrian Chadddomains are mapped into a contiguous, non-sparse
1126520495aSAdrian ChaddVM domain space, starting from 0.
1136520495aSAdrian ChaddThus, VM domain information (for example, the domain identifier) is not
1146520495aSAdrian Chaddnecessarily the same as is found in the hardware specific information.
1156520495aSAdrian ChaddPolicy information is available in both struct thread and struct proc.
1166520495aSAdrian Chadd.Sh SEE ALSO
117b3042426SKonstantin Belousov.Xr cpuset 1 ,
118b3042426SKonstantin Belousov.Xr cpuset_getaffinity 2 ,
119b3042426SKonstantin Belousov.Xr cpuset_setaffinity 2 ,
1206520495aSAdrian Chadd.Xr bus_get_domain 9
1216520495aSAdrian Chadd.Sh HISTORY
1226520495aSAdrian Chadd.Nm
1236520495aSAdrian Chaddfirst appeared in
1246520495aSAdrian Chadd.Fx 9.0
1256520495aSAdrian Chaddas a first-touch allocation policy with a fail-over to round-robin allocation
1266520495aSAdrian Chaddand was not configurable.
1276520495aSAdrian ChaddIt was then modified in
1286520495aSAdrian Chadd.Fx 10.0
1296520495aSAdrian Chaddto implement a round-robin allocation policy and was also not configurable.
1306520495aSAdrian Chadd.Pp
1316520495aSAdrian ChaddThe
1326520495aSAdrian Chadd.Xr numa_getaffinity 2
1336520495aSAdrian Chaddand
1346520495aSAdrian Chadd.Xr numa_setaffinity 2
135b3042426SKonstantin Belousovsyscalls and the
1366520495aSAdrian Chadd.Xr numactl 1
1376520495aSAdrian Chaddtool first appeared in
138b3042426SKonstantin Belousov.Fx 11.0
139b3042426SKonstantin Belousovand were removed in
140b3042426SKonstantin Belousov.Fx 12.0 .
141*b61f3142SMark JohnstonThe current implementation appeared in
142b3042426SKonstantin Belousov.Fx 12.0 .
143b3042426SKonstantin Belousov.Pp
1446520495aSAdrian Chadd.Sh AUTHORS
1456520495aSAdrian ChaddThis manual page written by
1466520495aSAdrian Chadd.An Adrian Chadd Aq Mt adrian@FreeBSD.org .
1476520495aSAdrian Chadd.Sh NOTES
1486520495aSAdrian ChaddNo statistics are kept to indicate how often
1496520495aSAdrian Chadd.Nm
1506520495aSAdrian Chaddallocation policies succeed or fail.
151