android_kernel_xiaomi_sm8350/arch/ia64/kernel
Christoph Lameter 742755a1d8 [PATCH] page migration: sys_move_pages(): support moving of individual pages
move_pages() is used to move individual pages of a process. The function can
be used to determine the location of pages and to move them onto the desired
node. move_pages() returns status information for each page.

long move_pages(pid, number_of_pages_to_move,
		addresses_of_pages[],
		nodes[] or NULL,
		status[],
		flags);

The addresses of pages is an array of void * pointing to the
pages to be moved.

The nodes array contains the node numbers that the pages should be moved
to. If a NULL is passed instead of an array then no pages are moved but
the status array is updated. The status request may be used to determine
the page state before issuing another move_pages() to move pages.

The status array will contain the state of all individual page migration
attempts when the function terminates. The status array is only valid if
move_pages() completed successfullly.

Possible page states in status[]:

0..MAX_NUMNODES	The page is now on the indicated node.

-ENOENT		Page is not present

-EACCES		Page is mapped by multiple processes and can only
		be moved if MPOL_MF_MOVE_ALL is specified.

-EPERM		The page has been mlocked by a process/driver and
		cannot be moved.

-EBUSY		Page is busy and cannot be moved. Try again later.

-EFAULT		Invalid address (no VMA or zero page).

-ENOMEM		Unable to allocate memory on target node.

-EIO		Unable to write back page. The page must be written
		back in order to move it since the page is dirty and the
		filesystem does not provide a migration function that
		would allow the moving of dirty pages.

-EINVAL		A dirty page cannot be moved. The filesystem does not provide
		a migration function and has no ability to write back pages.

The flags parameter indicates what types of pages to move:

MPOL_MF_MOVE	Move pages that are only mapped by the process.

MPOL_MF_MOVE_ALL Also move pages that are mapped by multiple processes.
		Requires sufficient capabilities.

Possible return codes from move_pages()

-ENOENT		No pages found that would 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.

-EINVAL		Flags other than MPOL_MF_MOVE(_ALL) specified or an attempt
		to migrate pages in a kernel thread.

-EPERM		MPOL_MF_MOVE_ALL specified without sufficient priviledges.
		or an attempt to move a process belonging to another user.

-EACCES		One of the target nodes is not allowed by the current cpuset.

-ENODEV		One of the target nodes is not online.

-ESRCH		Process does not exist.

-E2BIG		Too many pages to move.

-ENOMEM		Not enough memory to allocate control array.

-EFAULT		Parameters could not be accessed.

A test program for move_pages() may be found with the patches
on ftp.kernel.org:/pub/linux/kernel/people/christoph/pmig/patches-2.6.17-rc4-mm3

From: Christoph Lameter <clameter@sgi.com>

  Detailed results for sys_move_pages()

  Pass a pointer to an integer to get_new_page() that may be used to
  indicate where the completion status of a migration operation should be
  placed.  This allows sys_move_pags() to report back exactly what happened to
  each page.

  Wish there would be a better way to do this. Looks a bit hacky.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Jes Sorensen <jes@trained-monkey.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Andi Kleen <ak@muc.de>
Cc: Michael Kerrisk <mtk-manpages@gmx.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-23 07:42:53 -07:00
..
cpufreq [ACPI] IA64 ZX1 buildfix for _PDC patch 2005-12-05 17:24:45 -05:00
acpi-ext.c [IA64] update HP CSR space discovery via ACPI 2006-04-06 14:42:38 -07:00
acpi-processor.c [ACPI] IA64 ZX1 buildfix for _PDC patch 2005-12-05 17:24:45 -05:00
acpi.c [PATCH] Unify pxm_to_node() and node_to_pxm() 2006-06-23 07:42:48 -07:00
asm-offsets.c [IA64] fix circular dependency on generation of asm-offsets.h 2005-09-13 08:50:39 -07:00
brl_emu.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cyclone.c [IA64] don't report !sn2 or !summit hardware as an error 2006-03-07 15:26:49 -08:00
efi_stub.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
efi.c [PATCH] EFI: keep physical table addresses in efi structure 2006-03-26 08:56:54 -08:00
entry.h [IA64] Drop spurious paren in entry.h 2005-06-20 09:34:02 -07:00
entry.S [PATCH] page migration: sys_move_pages(): support moving of individual pages 2006-06-23 07:42:53 -07:00
fsys.S [IA64] cleanup in fsys.S 2006-02-28 08:53:32 -08:00
gate-data.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
gate.lds.S [IA64] Add __mca_table to the DISCARD list in gate.lds 2006-03-30 09:04:19 -08:00
gate.S kbuild: ia64 use generic asm-offsets.h support 2005-09-09 22:03:13 +02:00
head.S [IA64] Fix CONFIG_PRINTK_TIME 2006-02-07 15:25:57 -08:00
ia64_ksyms.c [IA64] Remove duplicate EXPORT_SYMBOLs 2006-02-15 13:23:32 -08:00
init_task.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
iosapic.c [IA64] fix broken irq affinity 2006-05-17 06:20:23 -07:00
irq_ia64.c [PATCH] PCI: per-platform IA64_{FIRST,LAST}_DEVICE_VECTOR definitions 2006-06-21 11:59:59 -07:00
irq_lsapic.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
irq.c [IA64] one-line cleanup on set_irq_affinity_info 2006-05-17 06:20:59 -07:00
ivt.S [IA64] MCA recovery: kernel context recovery table 2006-03-24 09:49:52 -08:00
jprobes.S [IA64] prevent accidental modification of args in jprobe handler 2006-01-13 14:45:21 -08:00
kprobes.c [PATCH] Switch Kprobes inline functions to __kprobes for ia64 2006-04-19 09:13:53 -07:00
machvec.c IA64: Use early_parm to handle mvec_name and nomca 2006-03-23 14:27:12 -08:00
Makefile [PATCH] DMI: move dmi_scan.c from arch/i386 to drivers/firmware/ 2006-04-14 11:41:25 -07:00
mca_asm.S [IA64] Failure to resume after INIT in user space 2006-04-07 23:01:32 -07:00
mca_drv_asm.S [IA64] MCA recovery: kernel context recovery table 2006-03-24 09:49:52 -08:00
mca_drv.c [IA64] Add mca recovery failure messages 2006-04-27 14:34:01 -07:00
mca_drv.h [IA64] MCA recovery: kernel context recovery table 2006-03-24 09:49:52 -08:00
mca.c [IA64] ia64_wait_for_slaves() incorrectly reports MCA 2006-04-13 14:57:18 -07:00
minstate.h [IA64] MCA/INIT: remove the physical mode path from minstate.h 2005-09-11 14:09:12 -07:00
module.c [IA64] for_each_possible_cpu: ia64 2006-04-06 15:03:49 -07:00
numa.c [IA64] Increase max node count on SN platforms 2006-03-24 13:14:41 -08:00
pal.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
palinfo.c [PATCH] Remove __devinit and __cpuinit from notifier_call definitions 2006-04-26 08:30:03 -07:00
patch.c [IA64] add init declaration - gate page functions 2006-03-22 16:54:38 -08:00
perfmon_default_smpl.c [IA64] perfmon: make pfm_sysctl a global, and other cleanup 2005-04-25 13:08:30 -07:00
perfmon_generic.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
perfmon_itanium.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
perfmon_mckinley.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
perfmon_montecito.h [IA64] Perfmon for Montecito 2006-01-16 10:31:44 -08:00
perfmon.c [PATCH] VFS: Permit filesystem to override root dentry on mount 2006-06-23 07:42:45 -07:00
process.c [PATCH] kretprobe instance recycled by parent process 2006-03-26 08:57:04 -08:00
ptrace.c [PATCH] drop task argument of audit_syscall_{entry,exit} 2006-05-01 06:06:18 -04:00
sal.c [IA64] avoid broken SAL_CACHE_FLUSH implementations 2006-02-02 13:25:54 -08:00
salinfo.c [PATCH] Remove __devinit and __cpuinit from notifier_call definitions 2006-04-26 08:30:03 -07:00
semaphore.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
setup.c [PATCH] EFI: keep physical table addresses in efi structure 2006-03-26 08:56:54 -08:00
sigframe.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
signal.c [IA64] Delete MCA/INIT sigdelayed code 2006-01-26 13:23:27 -08:00
smp.c [IA64] wider use of for_each_cpu_mask() in arch/ia64 2005-10-25 15:10:08 -07:00
smpboot.c [IA64] New IA64 core/thread detection patch 2006-03-24 13:15:23 -08:00
sys_ia64.c [PATCH] ia64: task_pt_regs() 2006-01-12 09:08:58 -08:00
time.c [IA64] Avoid "u64 foo : 32;" for gcc3 vs. gcc4 compatibility 2006-03-31 10:28:29 -08:00
topology.c Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 2006-04-27 17:01:37 -07:00
traps.c [PATCH] Notifier chain update: API changes 2006-03-27 08:44:50 -08:00
unaligned.c [IA64] sysctl option to silence unaligned trap warnings 2006-02-28 09:42:23 -08:00
uncached.c [PATCH] change gen_pool allocator to not touch managed memory 2006-06-23 07:42:49 -07:00
unwind_decoder.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
unwind_i.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
unwind.c [IA64] MCA/INIT: remove obsolete unwind code 2005-09-11 14:09:34 -07:00
vmlinux.lds.S [IA64] Move __mca_table out of the __init section 2006-03-29 10:43:04 -08:00