printf.3: Rework '
[man-pages.git] / man / man7 / numa.7
blobac3e38112cd5976ddde0b3064200ac82a81c77ca
1 .\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk
2 .\"     <mtk.manpages@gmail.com>
3 .\" and Copyright 2003,2004 Andi Kleen, SuSE Labs.
4 .\" numa_maps material Copyright (c) 2005 Silicon Graphics Incorporated.
5 .\"     Christoph Lameter, <cl@linux-foundation.org>.
6 .\"
7 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
8 .\"
9 .TH numa 7 (date) "Linux man-pages (unreleased)"
10 .SH NAME
11 numa \- overview of Non-Uniform Memory Architecture
12 .SH DESCRIPTION
13 Non-Uniform Memory Access (NUMA) refers to multiprocessor systems
14 whose memory is divided into multiple memory nodes.
15 The access time of a memory node depends on
16 the relative locations of the accessing CPU and the accessed node.
17 (This contrasts with a symmetric multiprocessor system,
18 where the access time for all of the memory is the same for all CPUs.)
19 Normally, each CPU on a NUMA system has a local memory node whose
20 contents can be accessed faster than the memory in
21 the node local to another CPU
22 or the memory on a bus shared by all CPUs.
23 .SS NUMA system calls
24 The Linux kernel implements the following NUMA-related system calls:
25 .BR get_mempolicy (2),
26 .BR mbind (2),
27 .BR migrate_pages (2),
28 .BR move_pages (2),
29 and
30 .BR set_mempolicy (2).
31 However, applications should normally use the interface provided by
32 .IR libnuma ;
33 see "Library Support" below.
34 .SS \fI/proc/\fPpid\fI/numa_maps\fP  (since Linux 2.6.14)
35 .\" See also Changelog-2.6.14
36 This file displays information about a process's
37 NUMA memory policy and allocation.
39 Each line contains information about a memory range used by the process,
40 displaying\[em]among other information\[em]the effective memory policy for
41 that memory range and on which nodes the pages have been allocated.
43 .I numa_maps
44 is a read-only file.
45 When
46 .IR /proc/ pid /numa_maps
47 is read, the kernel will scan the virtual address space of the
48 process and report how memory is used.
49 One line is displayed for each unique memory range of the process.
51 The first field of each line shows the starting address of the memory range.
52 This field allows a correlation with the contents of the
53 .IR /proc/ pid /maps
54 file,
55 which contains the end address of the range and other information,
56 such as the access permissions and sharing.
58 The second field shows the memory policy currently in effect for the
59 memory range.
60 Note that the effective policy is not necessarily the policy
61 installed by the process for that memory range.
62 Specifically, if the process installed a "default" policy for that range,
63 the effective policy for that range will be the process policy,
64 which may or may not be "default".
66 The rest of the line contains information about the pages allocated in
67 the memory range, as follows:
68 .TP
69 .I N<node>=<nr_pages>
70 The number of pages allocated on
71 .IR <node> .
72 .I <nr_pages>
73 includes only pages currently mapped by the process.
74 Page migration and memory reclaim may have temporarily unmapped pages
75 associated with this memory range.
76 These pages may show up again only after the process has
77 attempted to reference them.
78 If the memory range represents a shared memory area or file mapping,
79 other processes may currently have additional pages mapped in a
80 corresponding memory range.
81 .TP
82 .I file=<filename>
83 The file backing the memory range.
84 If the file is mapped as private, write accesses may have generated
85 COW (Copy-On-Write) pages in this memory range.
86 These pages are displayed as anonymous pages.
87 .TP
88 .I heap
89 Memory range is used for the heap.
90 .TP
91 .I stack
92 Memory range is used for the stack.
93 .TP
94 .I huge
95 Huge memory range.
96 The page counts shown are huge pages and not regular sized pages.
97 .TP
98 .I anon=<pages>
99 The number of anonymous page in the range.
101 .I dirty=<pages>
102 Number of dirty pages.
104 .I mapped=<pages>
105 Total number of mapped pages, if different from
106 .I dirty
108 .I anon
109 pages.
111 .I mapmax=<count>
112 Maximum mapcount (number of processes mapping a single page) encountered
113 during the scan.
114 This may be used as an indicator of the degree of sharing occurring in a
115 given memory range.
117 .I swapcache=<count>
118 Number of pages that have an associated entry on a swap device.
120 .I active=<pages>
121 The number of pages on the active list.
122 This field is shown only if different from the number of pages in this range.
123 This means that some inactive pages exist in the memory range that may be
124 removed from memory by the swapper soon.
126 .I writeback=<pages>
127 Number of pages that are currently being written out to disk.
128 .SH STANDARDS
129 None.
130 .SH NOTES
131 The Linux NUMA system calls and
132 .I /proc
133 interface are available only
134 if the kernel was configured and built with the
135 .B CONFIG_NUMA
136 option.
137 .SS Library support
138 Link with \fI\-lnuma\fP
139 to get the system call definitions.
140 .I libnuma
141 and the required
142 .I <numaif.h>
143 header are available in the
144 .I numactl
145 package.
147 However, applications should not use these system calls directly.
148 Instead, the higher level interface provided by the
149 .BR numa (3)
150 functions in the
151 .I numactl
152 package is recommended.
154 .I numactl
155 package is available at
156 .UR ftp://oss.sgi.com\:/www\:/projects\:/libnuma\:/download/
157 .UE .
158 The package is also included in some Linux distributions.
159 Some distributions include the development library and header
160 in the separate
161 .I numactl\-devel
162 package.
163 .SH SEE ALSO
164 .BR get_mempolicy (2),
165 .BR mbind (2),
166 .BR move_pages (2),
167 .BR set_mempolicy (2),
168 .BR numa (3),
169 .BR cpuset (7),
170 .BR numactl (8)