2
* Copyright (C) 2005 Christoph Lameter, Silicon Graphics, Incorporated.
3
* based on Andi Kleen's numactl.c.
5
* Manual process migration
7
* migratepages is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public
9
* License as published by the Free Software Foundation; version 2.
11
* migratepages is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
16
* You should find a copy of v2 of the GNU General Public License somewhere
17
* on your Linux system; if not, write to the Free Software Foundation,
18
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34
struct option opts[] = {
42
"usage: migratepages pid from-nodes to-nodes\n"
44
"nodes is a comma delimited list of node numbers or A-B ranges or all.\n"
53
if (numa_available() < 0)
54
complain("This system does not support NUMA functionality");
59
int main(int argc, char *argv[])
68
while ((c = getopt_long(argc,argv,"h", opts, NULL)) != -1) {
83
pid = strtoul(argv[0], &end, 0);
84
if (*end || end == argv[0])
87
fromnodes = nodemask(argv[1]);
88
tonodes = nodemask(argv[2]);
90
rc = numa_migrate_pages(pid, &fromnodes, &tonodes);
93
perror("migrate_pages");