xref: /freebsd/share/man/man4/numa.4 (revision b3042426d0d710e883bfa4cb6905e9e9de0d867c)
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*b3042426SKonstantin Belousov.Dd July 10, 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
346520495aSAdrian Chadd.Cd options SMP
356520495aSAdrian Chadd.Cd options MAXMEMDOM=16
366520495aSAdrian Chadd.Pp
376520495aSAdrian Chadd.In sys/cpuset.h
386520495aSAdrian Chadd.In sys/bus.h
396520495aSAdrian Chadd.Sh DESCRIPTION
406520495aSAdrian ChaddNon-Uniform Memory Access is a computer architecture design which
416520495aSAdrian Chaddinvolves unequal costs between processors, memory and IO devices
426520495aSAdrian Chaddin a given system.
436520495aSAdrian Chadd.Pp
446520495aSAdrian ChaddIn a
456520495aSAdrian Chadd.Nm
466520495aSAdrian Chaddarchitecture, the latency to access specific memory or IO devices
476520495aSAdrian Chadddepends upon which processor the memory or device is attached to.
486520495aSAdrian ChaddAccessing memory local to a processor is faster than accessing memory
496520495aSAdrian Chaddthat is connected to one of the other processors.
506520495aSAdrian Chadd.Pp
516520495aSAdrian Chadd.Nm
526520495aSAdrian Chaddis enabled when the
53*b3042426SKonstantin Belousov.Cd NUMA
546520495aSAdrian Chaddoption is used in a kernel configuration
55*b3042426SKonstantin Belousovfile and the
56*b3042426SKonstantin Belousov.Cd MAXMEMDOM
57*b3042426SKonstantin Belousovoption is set to a value greater than 1.
586520495aSAdrian Chadd.Pp
596520495aSAdrian ChaddThread and process
606520495aSAdrian Chadd.Nm
616520495aSAdrian Chaddpolicies are controlled with the
62*b3042426SKonstantin Belousov.Xr cpuset_getdomain 2
636520495aSAdrian Chaddand
64*b3042426SKonstantin Belousov.Xr cpuset_setdomain 2
656520495aSAdrian Chaddsyscalls.
666520495aSAdrian ChaddThe
67*b3042426SKonstantin Belousov.Xr cpuset 1
686520495aSAdrian Chaddtool is available for starting processes with a non-default
696520495aSAdrian Chaddpolicy, or to change the policy of an existing thread or process.
706520495aSAdrian Chadd.Pp
716520495aSAdrian ChaddSystems with non-uniform access to I/O devices may mark those devices
726520495aSAdrian Chaddwith the local VM domain identifier.
736520495aSAdrian ChaddDrivers can find out their local domain information by calling
746520495aSAdrian Chadd.Xr bus_get_domain 9 .
756520495aSAdrian Chadd.Ss MIB Variables
766520495aSAdrian ChaddThe operation of
776520495aSAdrian Chadd.Nm
786520495aSAdrian Chaddis controlled and exposes information with these
796520495aSAdrian Chadd.Xr sysctl 8
806520495aSAdrian ChaddMIB variables:
816520495aSAdrian Chadd.Pp
826520495aSAdrian Chadd.Bl -tag -width indent -compact
836520495aSAdrian Chadd.It Va vm.ndomains
846520495aSAdrian ChaddThe number of VM domains which have been detected.
856520495aSAdrian Chadd.Pp
866520495aSAdrian Chadd.It Va vm.phys_locality
876520495aSAdrian ChaddA table indicating the relative cost of each VM domain to each other.
886520495aSAdrian ChaddA value of 10 indicates equal cost.
896520495aSAdrian ChaddA value of -1 means the locality map is not available or no
906520495aSAdrian Chaddlocality information is available.
916520495aSAdrian Chadd.Pp
926520495aSAdrian Chadd.It Va vm.phys_segs
936520495aSAdrian ChaddThe map of physical memory, grouped by VM domain.
946520495aSAdrian Chadd.El
956520495aSAdrian Chadd.Sh IMPLEMENTATION NOTES
966520495aSAdrian ChaddThe current
976520495aSAdrian Chadd.Nm
986520495aSAdrian Chaddimplementation is VM-focused.
996520495aSAdrian ChaddThe hardware
1006520495aSAdrian Chadd.Nm
1016520495aSAdrian Chadddomains are mapped into a contiguous, non-sparse
1026520495aSAdrian ChaddVM domain space, starting from 0.
1036520495aSAdrian ChaddThus, VM domain information (for example, the domain identifier) is not
1046520495aSAdrian Chaddnecessarily the same as is found in the hardware specific information.
1056520495aSAdrian ChaddPolicy information is available in both struct thread and struct proc.
1066520495aSAdrian Chadd.Sh SEE ALSO
107*b3042426SKonstantin Belousov.Xr cpuset 1 ,
108*b3042426SKonstantin Belousov.Xr cpuset_getaffinity 2 ,
109*b3042426SKonstantin Belousov.Xr cpuset_setaffinity 2 ,
1106520495aSAdrian Chadd.Xr bus_get_domain 9
1116520495aSAdrian Chadd.Sh HISTORY
1126520495aSAdrian Chadd.Nm
1136520495aSAdrian Chaddfirst appeared in
1146520495aSAdrian Chadd.Fx 9.0
1156520495aSAdrian Chaddas a first-touch allocation policy with a fail-over to round-robin allocation
1166520495aSAdrian Chaddand was not configurable.
1176520495aSAdrian ChaddIt was then modified in
1186520495aSAdrian Chadd.Fx 10.0
1196520495aSAdrian Chaddto implement a round-robin allocation policy and was also not configurable.
1206520495aSAdrian Chadd.Pp
1216520495aSAdrian ChaddThe
1226520495aSAdrian Chadd.Xr numa_getaffinity 2
1236520495aSAdrian Chaddand
1246520495aSAdrian Chadd.Xr numa_setaffinity 2
125*b3042426SKonstantin Belousovsyscalls and the
1266520495aSAdrian Chadd.Xr numactl 1
1276520495aSAdrian Chaddtool first appeared in
128*b3042426SKonstantin Belousov.Fx 11.0
129*b3042426SKonstantin Belousovand were removed in
130*b3042426SKonstantin Belousov.Fx 12.0 .
131*b3042426SKonstantin BelousovCurrent implementation appeared in
132*b3042426SKonstantin Belousov.Fx 12.0 .
133*b3042426SKonstantin Belousov.Pp
1346520495aSAdrian Chadd.Sh AUTHORS
1356520495aSAdrian ChaddThis manual page written by
1366520495aSAdrian Chadd.An Adrian Chadd Aq Mt adrian@FreeBSD.org .
1376520495aSAdrian Chadd.Sh NOTES
1386520495aSAdrian ChaddNo statistics are kept to indicate how often
1396520495aSAdrian Chadd.Nm
1406520495aSAdrian Chaddallocation policies succeed or fail.
141