|MOVE_PAGES(2)||Linux Programmer's Manual||MOVE_PAGES(2)|
NAMEmove_pages - move individual pages of a process to another node
long move_pages(int pid , unsigned long count, void ** pages ,
const int * nodes , int * status , int flags );
DESCRIPTIONmove_pages() moves the specified pages of the process pid to the memory nodes specified by nodes. The result of the move is reflected in status. The flags indicate constraints on the pages to be moved.
Page states in the status arrayThe following values can be returned in each element of the status array.
- Identifies the node on which the page resides.
- The page is mapped by multiple processes and can be moved only if MPOL_MF_MOVE_ALL is specified.
- The page is currently busy and cannot be moved. Try again later. This occurs if a page is undergoing I/O or another kernel subsystem is holding a reference to the page.
- This is a zero page or the memory area is not mapped by the process.
- Unable to write back a page. The page has to be written back in order to move it since the page is dirty and the file system does not provide a migration function that would allow the move of dirty pages.
- A dirty page cannot be moved. The file system does not provide a migration function and has no ability to write back pages.
- The page is not present.
- Unable to allocate memory on target node.
RETURN VALUEOn success move_pages() returns zero. On error, it returns -1, and sets errno to indicate the error.
- Too many pages to move.
- One of the target nodes is not allowed by the current cpuset.
- Parameter array could not be accessed.
- Flags other than MPOL_MF_MOVE and MPOL_MF_MOVE_ALL was specified or an attempt was made to migrate pages of a kernel thread.
- One of the target nodes is not online.
- No pages were found that require moving. All pages are either already on the target node, not present, had an invalid address or could not be moved because they were mapped by multiple processes.
- The caller specified MPOL_MF_MOVE_ALL without sufficient privileges ( CAP_SYS_NICE). Or, the caller attempted to move pages of a process belonging to another user but did not have privilege to do so ( CAP_SYS_NICE).
- Process does not exist.
VERSIONSmove_pages() first appeared on Linux in version 2.6.18.
CONFORMING TOThis system call is Linux-specific.
NOTESFor information on library support, see numa(7).
SEE ALSOget_mempolicy(2), mbind(2), set_mempolicy(2), numa(3), numa_maps(5), cpuset(7), numa(7), migratepages(8), numastat(8)
COLOPHONThis page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.