OSDN Git Service

64af9a8befb40517db6d34d9653bb3f952c4445a
[linuxjm/LDP_man-pages.git] / original / man7 / numa.7
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 .\" Permission is granted to make and distribute verbatim copies of this
8 .\" manual provided the copyright notice and this permission notice are
9 .\" preserved on all copies.
10 .\"
11 .\" Permission is granted to copy and distribute modified versions of this
12 .\" manual under the conditions for verbatim copying, provided that the
13 .\" entire resulting derived work is distributed under the terms of a
14 .\" permission notice identical to this one.
15 .\"
16 .\" Since the Linux kernel and libraries are constantly changing, this
17 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
18 .\" responsibility for errors or omissions, or for damages resulting from
19 .\" the use of the information contained herein.  The author(s) may not
20 .\" have taken the same level of care in the production of this manual,
21 .\" which is licensed free of charge, as they might when working
22 .\" professionally.
23 .\"
24 .\" Formatted or processed versions of this manual, if unaccompanied by
25 .\" the source, must acknowledge the copyright and authors of this work.
26 .\"
27 .TH NUMA 7 2008-08-15 "Linux" "Linux Programmer's Manual"
28 .SH NAME
29 numa \- overview of Non-Uniform Memory Architecture
30 .SH DESCRIPTION
31 Non-Uniform Memory Access (NUMA) refers to multiprocessor systems
32 whose memory is divided into multiple memory nodes.
33 The access time of a memory node depends on
34 the relative locations of the accessing CPU and the accessed node.
35 (This contrasts with a symmetric multiprocessor system,
36 where the access time for all of the memory is the same for all CPUs.)
37 Normally, each CPU on a NUMA system has a local memory node whose
38 contents can be accessed faster than the memory in
39 the node local to another CPU
40 or the memory on a bus shared by all CPUs.
41 .SS NUMA system calls
42 The Linux kernel implements the following NUMA-related system calls:
43 .BR get_mempolicy (2),
44 .BR mbind (2),
45 .BR migrate_pages (2),
46 .BR move_pages (2),
47 and
48 .BR set_mempolicy (2).
49 However, applications should normally use the interface provided by
50 .IR libnuma ;
51 see "Library Support" below.
52 .SS /proc/[number]/numa_maps " (since Linux 2.6.14)"
53 .\" See also Changelog-2.6.14
54 This file displays information about a process's
55 NUMA memory policy and allocation.
56
57 Each line contains information about a memory range used by the process,
58 displaying\(emamong other information\(emthe effective memory policy for
59 that memory range and on which nodes the pages have been allocated.
60
61 .I numa_maps
62 is a read-only file.
63 When
64 .I /proc/<pid>/numa_maps
65 is read, the kernel will scan the virtual address space of the
66 process and report how memory is used.
67 One line is displayed for each unique memory range of the process.
68
69 The first field of each line shows the starting address of the memory range.
70 This field allows a correlation with the contents of the
71 .I /proc/<pid>/maps
72 file,
73 which contains the end address of the range and other information,
74 such as the access permissions and sharing.
75
76 The second field shows the memory policy currently in effect for the
77 memory range.
78 Note that the effective policy is not necessarily the policy
79 installed by the process for that memory range.
80 Specifically, if the process installed a "default" policy for that range,
81 the effective policy for that range will be the process policy,
82 which may or may not be "default".
83
84 The rest of the line contains information about the pages allocated in
85 the memory range, as follows:
86 .TP
87 .I N<node>=<nr_pages>
88 The number of pages allocated on
89 .IR <node> .
90 .I <nr_pages>
91 includes only pages currently mapped by the process.
92 Page migration and memory reclaim may have temporarily unmapped pages
93 associated with this memory range.
94 These pages may only show up again after the process has
95 attempted to reference them.
96 If the memory range represents a shared memory area or file mapping,
97 other processes may currently have additional pages mapped in a
98 corresponding memory range.
99 .TP
100 .I file=<filename>
101 The file backing the memory range.
102 If the file is mapped as private, write accesses may have generated
103 COW (Copy-On-Write) pages in this memory range.
104 These pages are displayed as anonymous pages.
105 .TP
106 .I heap
107 Memory range is used for the heap.
108 .TP
109 .I stack
110 Memory range is used for the stack.
111 .TP
112 .I huge
113 Huge memory range.
114 The page counts shown are huge pages and not regular sized pages.
115 .TP
116 .I anon=<pages>
117 The number of anonymous page in the range.
118 .TP
119 .I dirty=<pages>
120 Number of dirty pages.
121 .TP
122 .I mapped=<pages>
123 Total number of mapped pages, if different from
124 .IR dirty
125 and
126 .I anon
127 pages.
128 .TP
129 .I mapmax=<count>
130 Maximum mapcount (number of processes mapping a single page) encountered
131 during the scan.
132 This may be used as an indicator of the degree of sharing occurring in a
133 given memory range.
134 .TP
135 .I swapcache=<count>
136 Number of pages that have an associated entry on a swap device.
137 .TP
138 .I active=<pages>
139 The number of pages on the active list.
140 This field is only shown if different from the number of pages in this range.
141 This means that some inactive pages exist in the memory range that may be
142 removed from memory by the swapper soon.
143 .TP
144 .I writeback=<pages>
145 Number of pages that are currently being written out to disk.
146 .SH NOTES
147 The Linux NUMA system calls and
148 .I /proc
149 interface are only available
150 if the kernel was configured and built with the
151 .BR CONFIG_NUMA
152 option.
153 .SS Library Support
154 Link with \fI\-lnuma\fP
155 to get the system call definitions.
156 .I libnuma
157 and the required
158 .I <numaif.h>
159 header are available in the
160 .I numactl
161 package.
162
163 However, applications should not use these system calls directly.
164 Instead, the higher level interface provided by the
165 .BR numa (3)
166 functions in the
167 .I numactl
168 package is recommended.
169 The
170 .I numactl
171 package is available at
172 .IR ftp://oss.sgi.com/www/projects/libnuma/download/ .
173 The package is also included in some Linux distributions.
174 Some distributions include the development library and header
175 in the separate
176 .I numactl-devel
177 package.
178 .SH "CONFORMING TO"
179 No standards govern NUMA interfaces.
180 .SH "SEE ALSO"
181 .BR get_mempolicy (2),
182 .BR mbind (2),
183 .BR move_pages (2),
184 .BR set_mempolicy (2),
185 .BR numa (3),
186 .BR cpuset (7),
187 .BR numactl (8)