1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright 2009 Intel Corporation
5 .\" Based on the move_pages manpage which was
6 .\" This manpage is Copyright (C) 2006 Silicon Graphics, Inc.
9 .\" Permission is granted to make and distribute verbatim copies of this
10 .\" manual provided the copyright notice and this permission notice are
11 .\" preserved on all copies.
13 .\" Permission is granted to copy and distribute modified versions of this
14 .\" manual under the conditions for verbatim copying, provided that the
15 .\" entire resulting derived work is distributed under the terms of a
16 .\" permission notice identical to this one.
17 .TH MIGRATE_PAGES 2 2010-11-01 "Linux" "Linux Programmer's Manual"
19 migrate_pages \- move all pages in a process to another set of nodes
22 .B #include <numaif.h>
24 .BI "long migrate_pages(int " pid ", unsigned long " maxnode,
25 .BI " const unsigned long *" old_nodes,
26 .BI " const unsigned long *" new_nodes);
29 Link with \fI\-lnuma\fP.
32 moves all pages of the process
34 that are in memory nodes
36 to the memory nodes in
38 Pages not located in any node in
42 the kernel maintains the relative topology relationship inside
44 during the migration to
51 arguments are pointers to bit masks of node numbers, with up to
54 These masks are maintained as arrays of unsigned
58 integer, the bits beyond those specified by
63 argument is the maximum node number in the bit mask plus one (this is the same
71 argument is the ID of the process whose pages are to be moved.
72 To move pages in another process,
73 the caller must be privileged
75 or the real or effective user ID of the calling process must match the
76 real or saved-set user ID of the target process.
81 moves pages of the calling process.
83 Pages shared with another process will only be moved if the initiating
91 On error, it returns \-1, and sets
93 to indicate the error.
97 Insufficient privilege
99 to move pages of the process specified by
101 or insufficient privilege
103 to access the specified target nodes.
109 .\" FIXME There are other errors
113 system call first appeared on Linux in version 2.6.16.
115 This system call is Linux-specific.
117 For information on library support, see
121 .BR get_mempolicy (2)
123 .B MPOL_F_MEMS_ALLOWED
124 flag to obtain the set of nodes that are allowed by
125 the calling process's cpuset.
126 Note that this information is subject to change at any
127 time by manual or automatic reconfiguration of the cpuset.
131 may result in pages whose location
132 (node) violates the memory policy established for the
133 specified addresses (see
135 and/or the specified process (see
136 .BR set_mempolicy (2)).
137 That is, memory policy does not constrain the destination
139 .BR migrate_pages ().
143 header is not included with glibc, but requires installing
145 or a similar package.
147 .BR get_mempolicy (2),
149 .BR set_mempolicy (2),
154 .BR migratepages (8),
157 the kernel source file
158 .IR Documentation/vm/page_migration .