1 .\" Copyright 2009 Intel Corporation
3 .\" Based on the move_pages manpage which was
4 .\" This manpage is Copyright (C) 2006 Silicon Graphics, Inc.
7 .\" %%%LICENSE_START(VERBATIM_TWO_PARA)
8 .\" Permission is granted to make and distribute verbatim copies of this
9 .\" manual provided the copyright notice and this permission notice are
10 .\" preserved on all copies.
12 .\" Permission is granted to copy and distribute modified versions of this
13 .\" manual under the conditions for verbatim copying, provided that the
14 .\" entire resulting derived work is distributed under the terms of a
15 .\" permission notice identical to this one.
18 .TH MIGRATE_PAGES 2 2012-08-01 "Linux" "Linux Programmer's Manual"
20 migrate_pages \- move all pages in a process to another set of nodes
23 .B #include <numaif.h>
25 .BI "long migrate_pages(int " pid ", unsigned long " maxnode,
26 .BI " const unsigned long *" old_nodes,
27 .BI " const unsigned long *" new_nodes );
30 Link with \fI\-lnuma\fP.
33 attempts to move all pages of the process
35 that are in memory nodes
37 to the memory nodes in
39 Pages not located in any node in
43 the kernel maintains the relative topology relationship inside
45 during the migration to
52 arguments are pointers to bit masks of node numbers, with up to
55 These masks are maintained as arrays of unsigned
59 integer, the bits beyond those specified by
64 argument is the maximum node number in the bit mask plus one (this is the same
72 argument is the ID of the process whose pages are to be moved.
73 To move pages in another process,
74 the caller must be privileged
76 or the real or effective user ID of the calling process must match the
77 real or saved-set user ID of the target process.
82 moves pages of the calling process.
84 Pages shared with another process will be moved only if the initiating
91 returns the number of pages that could not be moved
92 (i.e., a return of zero means that all pages were successfully moved).
93 On error, it returns \-1, and sets
95 to indicate the error.
99 Insufficient privilege
101 to move pages of the process specified by
103 or insufficient privilege
105 to access the specified target nodes.
111 .\" FIXME Document the other errors that can occur for migrate_pages()
115 system call first appeared on Linux in version 2.6.16.
117 This system call is Linux-specific.
119 For information on library support, see
123 .BR get_mempolicy (2)
125 .B MPOL_F_MEMS_ALLOWED
126 flag to obtain the set of nodes that are allowed by
127 the calling process's cpuset.
128 Note that this information is subject to change at any
129 time by manual or automatic reconfiguration of the cpuset.
133 may result in pages whose location
134 (node) violates the memory policy established for the
135 specified addresses (see
137 and/or the specified process (see
138 .BR set_mempolicy (2)).
139 That is, memory policy does not constrain the destination
141 .BR migrate_pages ().
145 header is not included with glibc, but requires installing
147 or a similar package.
149 .BR get_mempolicy (2),
151 .BR set_mempolicy (2),
156 .BR migratepages (8),
159 .IR Documentation/vm/page_migration
160 in the Linux kernel source tree
162 This page is part of release 3.79 of the Linux
165 A description of the project,
166 information about reporting bugs,
167 and the latest version of this page,
169 \%http://www.kernel.org/doc/man\-pages/.