1 .\" Copyright (c) 2015 Adrian Chadd <adrian@FreeBSD.org>
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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.
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
32 .Nd Non-Uniform Memory Access
35 .Cd options MAXMEMDOM=16
41 Non-Uniform Memory Access is a computer architecture design which
42 involves unequal costs between processors, memory and IO devices
47 architecture, the latency to access specific memory or IO devices
48 depends upon which processor the memory or device is attached to.
49 Accessing memory local to a processor is faster than accessing memory
50 that is connected to one of the other processors.
55 option is used in a kernel configuration
56 file and is set to a value greater than 1.
60 policies are controlled with the
61 .Xr numa_setaffinity 2
63 .Xr numa_getaffinity 2
68 tool is available for starting processes with a non-default
69 policy, or to change the policy of an existing thread or process.
71 Systems with non-uniform access to I/O devices may mark those devices
72 with the local VM domain identifier.
73 Drivers can find out their local domain information by calling
74 .Xr bus_get_domain 9 .
78 is controlled and exposes information with these
82 .Bl -tag -width indent -compact
84 The number of VM domains which have been detected.
86 .It Va vm.default_policy
87 The default VM domain allocation policy.
88 Defaults to "first-touch-rr".
89 The valid values are "first-touch", "first-touch-rr",
90 "rr", where "rr" is a short-hand for "round-robin."
92 .Xr numa_setaffinity 2
93 for more information about the available policies.
95 .It Va vm.phys_locality
96 A table indicating the relative cost of each VM domain to each other.
97 A value of 10 indicates equal cost.
98 A value of -1 means the locality map is not available or no
99 locality information is available.
102 The map of physical memory, grouped by VM domain.
104 .Sh IMPLEMENTATION NOTES
107 implementation is VM-focused.
110 domains are mapped into a contiguous, non-sparse
111 VM domain space, starting from 0.
112 Thus, VM domain information (for example, the domain identifier) is not
113 necessarily the same as is found in the hardware specific information.
117 allocation policies are implemented as a policy and iterator in
118 .Pa sys/vm/vm_domain.c
120 .Pa sys/vm/vm_domain.h .
121 Policy information is available in both struct thread and struct proc.
124 policy from parent processes and threads inherit
126 policy from parent threads.
127 Note that threads do not explicitly inherit their
129 policy from processes.
130 Instead, if no thread policy is set, the system
131 will fall back to the process policy.
135 domain policies only influence physical page allocation in
136 .Pa sys/vm/vm_phys.c .
137 This is useful for userland memory allocation, but not for kernel
138 and driver memory allocation.
139 These features will be implemented in future work.
142 .Xr numa_getaffinity 2 ,
143 .Xr numa_setaffinity 2 ,
149 as a first-touch allocation policy with a fail-over to round-robin allocation
150 and was not configurable.
151 It was then modified in
153 to implement a round-robin allocation policy and was also not configurable.
156 .Xr numa_getaffinity 2
158 .Xr numa_setaffinity 2
159 syscalls first appeared in
164 tool first appeared in
167 This manual page written by
168 .An Adrian Chadd Aq Mt adrian@FreeBSD.org .
170 No statistics are kept to indicate how often
172 allocation policies succeed or fail.