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-ext.c [IA64] update HP CSR space discovery via ACPI 2006-04-06 14:42:38 -07:00
acpi-processor.c
acpi.c [PATCH] Unify pxm_to_node() and node_to_pxm() 2006-06-23 07:42:48 -07:00
asm-offsets.c
brl_emu.c
cyclone.c
efi_stub.S
efi.c [PATCH] EFI: keep physical table addresses in efi structure 2006-03-26 08:56:54 -08:00
entry.h
entry.S [PATCH] page migration: sys_move_pages(): support moving of individual pages 2006-06-23 07:42:53 -07:00
fsys.S
gate-data.S
gate.lds.S [IA64] Add __mca_table to the DISCARD list in gate.lds 2006-03-30 09:04:19 -08:00
gate.S
head.S
ia64_ksyms.c
init_task.c
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
irq.c [IA64] one-line cleanup on set_irq_affinity_info 2006-05-17 06:20:59 -07:00
ivt.S
jprobes.S
kprobes.c [PATCH] Switch Kprobes inline functions to __kprobes for ia64 2006-04-19 09:13:53 -07:00
machvec.c
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
mca_drv.c [IA64] Add mca recovery failure messages 2006-04-27 14:34:01 -07:00
mca_drv.h
mca.c [IA64] ia64_wait_for_slaves() incorrectly reports MCA 2006-04-13 14:57:18 -07:00
minstate.h
module.c [IA64] for_each_possible_cpu: ia64 2006-04-06 15:03:49 -07:00
numa.c
pal.S
palinfo.c [PATCH] Remove __devinit and __cpuinit from notifier_call definitions 2006-04-26 08:30:03 -07:00
patch.c
perfmon_default_smpl.c
perfmon_generic.h
perfmon_itanium.h
perfmon_mckinley.h
perfmon_montecito.h
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
salinfo.c [PATCH] Remove __devinit and __cpuinit from notifier_call definitions 2006-04-26 08:30:03 -07:00
semaphore.c
setup.c [PATCH] EFI: keep physical table addresses in efi structure 2006-03-26 08:56:54 -08:00
sigframe.h
signal.c
smp.c
smpboot.c
sys_ia64.c
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
uncached.c [PATCH] change gen_pool allocator to not touch managed memory 2006-06-23 07:42:49 -07:00
unwind_decoder.c
unwind_i.h
unwind.c
vmlinux.lds.S [IA64] Move __mca_table out of the __init section 2006-03-29 10:43:04 -08:00