]>
Commit | Line | Data |
---|---|---|
abe7c871 MK |
1 | .\" Hey Emacs! This file is -*- nroff -*- source. |
2 | .\" | |
3 | .\" This manpage is Copyright (C) 2006 Silicon Graphics, Inc. | |
4 | .\" Christoph Lameter | |
5 | .\" | |
6 | .\" Permission is granted to make and distribute verbatim copies of this | |
7 | .\" manual provided the copyright notice and this permission notice are | |
8 | .\" preserved on all copies. | |
9 | .\" | |
10 | .\" Permission is granted to copy and distribute modified versions of this | |
11 | .\" manual under the conditions for verbatim copying, provided that the | |
12 | .\" entire resulting derived work is distributed under the terms of a | |
13 | .\" permission notice identical to this one. | |
14 | .\" | |
15 | .\" FIXME Should programs normally be using this API directly, or should | |
16 | .\" they rather be using interfaces in the numactl package? | |
17 | .\" (e.g., compare with recommendation in mbind(2)). | |
1fd0fa43 | 18 | .TH MOVE_PAGES 2 2010-06-11 "Linux" "Linux Programmer's Manual" |
abe7c871 MK |
19 | .SH NAME |
20 | move_pages \- move individual pages of a process to another node | |
21 | .SH SYNOPSIS | |
22 | .nf | |
23 | .B #include <numaif.h> | |
24 | .sp | |
25 | .BI "long move_pages(int " pid ", unsigned long count, void **" pages , | |
26 | .BI " const int *" nodes ", int *" status ", int " flags ); | |
27 | .fi | |
cb8fbbcd AK |
28 | .sp |
29 | Link with \fI\-lnuma\fP. | |
abe7c871 MK |
30 | .SH DESCRIPTION |
31 | .BR move_pages () | |
32 | moves the specified | |
33 | .I pages | |
34 | of the process | |
35 | .I pid | |
36 | to the memory nodes specified by | |
37 | .IR nodes . | |
38 | The result of the move is reflected in | |
39 | .IR status . | |
40 | The | |
41 | .I flags | |
42 | indicate constraints on the pages to be moved. | |
43 | ||
44 | .I pid | |
45 | is the ID of the process in which pages are to be moved. | |
46 | To move pages in another process, | |
47 | the caller must be privileged | |
48 | .RB ( CAP_SYS_NICE ) | |
49 | or the real or effective user ID of the calling process must match the | |
50 | real or saved-set user ID of the target process. | |
51 | If | |
52 | .I pid | |
81fff50b | 53 | is 0, then |
abe7c871 MK |
54 | .BR move_pages () |
55 | moves pages of the calling process. | |
56 | ||
57 | .I count | |
58 | is the number of pages to move. | |
59 | It defines the size of the three arrays | |
60 | .IR pages , | |
61 | .IR nodes , | |
62 | and | |
63 | .IR status . | |
64 | ||
65 | .I pages | |
66 | is an array of pointers to the pages that should be moved. | |
67 | These are pointers that should be aligned to page boundaries. | |
68 | .\" FIXME what if they are not aligned? | |
69 | Addresses are specified as seen by the process specified by | |
70 | .IR pid . | |
71 | ||
72 | .I nodes | |
73 | is an array of integers that specify the desired location for each page. | |
74 | Each element in the array is a node number. | |
75 | .I nodes | |
76 | can also be NULL, in which case | |
77 | .BR move_pages () | |
78 | does not move any pages but instead will return the node | |
79 | where each page currently resides, in the | |
80 | .I status | |
81 | array. | |
82 | Obtaining the status of each page may be necessary to determine | |
83 | pages that need to be moved. | |
84 | ||
85 | .I status | |
86 | is an array of integers that return the status of each page. | |
87 | The array only contains valid values if | |
88 | .BR move_pages () | |
89 | did not return an error. | |
90 | ||
91 | .I flags | |
92 | specify what types of pages to move. | |
93 | .B MPOL_MF_MOVE | |
94 | means that only pages that are in exclusive use by the process | |
95 | are to be moved. | |
96 | .B MPOL_MF_MOVE_ALL | |
97 | means that pages shared between multiple processes can also be moved. | |
98 | The process must be privileged | |
99 | .RB ( CAP_SYS_NICE ) | |
100 | to use | |
101 | .BR MPOL_MF_MOVE_ALL . | |
102 | .SH Page states in the status array | |
103 | The following values can be returned in each element of the | |
104 | .I status | |
105 | array. | |
106 | .TP | |
107 | .B 0..MAX_NUMNODES | |
108 | Identifies the node on which the page resides. | |
109 | .TP | |
110 | .B -EACCES | |
111 | The page is mapped by multiple processes and can only be moved if | |
112 | .B MPOL_MF_MOVE_ALL | |
113 | is specified. | |
114 | .TP | |
115 | .B -EBUSY | |
116 | The page is currently busy and cannot be moved. | |
117 | Try again later. | |
118 | This occurs if a page is undergoing I/O or another kernel subsystem | |
119 | is holding a reference to the page. | |
120 | .TP | |
121 | .B -EFAULT | |
122 | This is a zero page or the memory area is not mapped by the process. | |
123 | .TP | |
124 | .B -EIO | |
125 | Unable to write back a page. | |
126 | The page has to be written back | |
e21a7c25 | 127 | in order to move it since the page is dirty and the file system |
abe7c871 MK |
128 | does not provide a migration function that would allow the move |
129 | of dirty pages. | |
130 | .TP | |
131 | .B -EINVAL | |
132 | A dirty page cannot be moved. | |
e21a7c25 | 133 | The file system does not |
abe7c871 MK |
134 | provide a migration function and has no ability to write back pages. |
135 | .TP | |
136 | .B -ENOENT | |
137 | The page is not present. | |
138 | .TP | |
139 | .B -ENOMEM | |
140 | Unable to allocate memory on target node. | |
141 | .SH "RETURN VALUE" | |
142 | On success | |
143 | .BR move_pages () | |
144 | returns zero. | |
145 | .\" FIXME Is the following quite true: does the wrapper in numactl | |
146 | .\" do the right thing? | |
147 | On error, it returns \-1, and sets | |
148 | .I errno | |
149 | to indicate the error. | |
150 | .SH ERRORS | |
151 | .TP | |
152 | .B E2BIG | |
153 | Too many pages to move. | |
154 | .TP | |