Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39743889 authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds
Browse files

[PATCH] Swap Migration V5: sys_migrate_pages interface



sys_migrate_pages implementation using swap based page migration

This is the original API proposed by Ray Bryant in his posts during the first
half of 2005 on linux-mm@kvack.org and linux-kernel@vger.kernel.org.

The intent of sys_migrate is to migrate memory of a process.  A process may
have migrated to another node.  Memory was allocated optimally for the prior
context.  sys_migrate_pages allows to shift the memory to the new node.

sys_migrate_pages is also useful if the processes available memory nodes have
changed through cpuset operations to manually move the processes memory.  Paul
Jackson is working on an automated mechanism that will allow an automatic
migration if the cpuset of a process is changed.  However, a user may decide
to manually control the migration.

This implementation is put into the policy layer since it uses concepts and
functions that are also needed for mbind and friends.  The patch also provides
a do_migrate_pages function that may be useful for cpusets to automatically
move memory.  sys_migrate_pages does not modify policies in contrast to Ray's
implementation.

The current code here is based on the swap based page migration capability and
thus is not able to preserve the physical layout relative to it containing
nodeset (which may be a cpuset).  When direct page migration becomes available
then the implementation needs to be changed to do a isomorphic move of pages
between different nodesets.  The current implementation simply evicts all
pages in source nodeset that are not in the target nodeset.

Patch supports ia64, i386 and x86_64.

Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent dc9aa5b9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -293,3 +293,4 @@ ENTRY(sys_call_table)
	.long sys_inotify_init
	.long sys_inotify_add_watch
	.long sys_inotify_rm_watch
	.long sys_migrate_pages
+1 −0
Original line number Diff line number Diff line
@@ -1600,5 +1600,6 @@ sys_call_table:
	data8 sys_inotify_init
	data8 sys_inotify_add_watch
	data8 sys_inotify_rm_watch
	data8 sys_migrate_pages			// 1280

	.org sys_call_table + 8*NR_syscalls	// guard against failures to increase NR_syscalls
+1 −0
Original line number Diff line number Diff line
@@ -643,6 +643,7 @@ ia32_sys_call_table:
	.quad sys_inotify_init
	.quad sys_inotify_add_watch
	.quad sys_inotify_rm_watch
	.quad sys_migrate_pages
ia32_syscall_end:		
	.rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8
		.quad ni_syscall
+2 −1
Original line number Diff line number Diff line
@@ -299,8 +299,9 @@
#define __NR_inotify_init	291
#define __NR_inotify_add_watch	292
#define __NR_inotify_rm_watch	293
#define __NR_migrate_pages	294

#define NR_syscalls 294
#define NR_syscalls 295

/*
 * user-visible error numbers are in the range -1 - -128: see
+2 −1
Original line number Diff line number Diff line
@@ -269,12 +269,13 @@
#define __NR_inotify_init		1277
#define __NR_inotify_add_watch		1278
#define __NR_inotify_rm_watch		1279
#define __NR_migrate_pages		1280

#ifdef __KERNEL__

#include <linux/config.h>

#define NR_syscalls			256 /* length of syscall table */
#define NR_syscalls			270 /* length of syscall table */

#define __ARCH_WANT_SYS_RT_SIGACTION

Loading