Skip to contentSkip to conversation

Migrate-on-fault prototype 4/5 V0.1 - handle misplaced anon pages

PATCH/RFC Lee Schermerhorn 1 participant 2 messages Mar 9, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Migrate-on-fault prototype 4/5 V0.1 - handle misplaced anon pages

This patch simply hooks the anon page fault handler [do_swap_page()] to check for and migrate misplaced pages.

File and shmem fault paths will be addressed in separate patches.

Index: linux-2.6.16-rc5-git8/mm/memory.c
===================================================================
--- linux-2.6.16-rc5-git8.orig/mm/memory.c 2006-03-06 13:40:48.000000000 -0500
+++ linux-2.6.16-rc5-git8/mm/memory.c 2006-03-07 08:53:30.000000000 -0500
@@ -48,6 +48,7 @@
#include <linux/rmap.h>
#include <linux/module.h>
#include <linux/init.h>
+#include <linux/mempolicy.h> /* check_migrate_misplaced_page() */

#include <asm/pgalloc.h>
#include <asm/uaccess.h>
@@ -1926,6 +1927,8 @@ again:

/* The page isn't present yet, go ahead with the fault. */

+ page = check_migrate_misplaced_page(page, vma, address); +
inc_mm_counter(mm, anon_rss);
pte = mk_pte(page, vma->vm_page_prot);
if (write_access && can_share_swap_page(page)) {

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#1 lore raw
Quoted 1 line · Lee Schermerhorn

Migrate-on-fault prototype 4/5 V0.1 - handle misplaced anon pages

Resend #4:

Migrate-on-fault prototype 4/5 V0.1 - handle misplaced anon pages

This patch simply hooks the anon page fault handler [do_swap_page()] to check for and migrate misplaced pages.

File and shmem fault paths will be addressed in separate patches.

mm/memory.c +3 -0
Index: linux-2.6.16-rc5-git8/mm/memory.c
===================================================================
@@ -48,6 +48,7 @@
 #include <linux/rmap.h>
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/mempolicy.h>	/* check_migrate_misplaced_page() */
 
 #include <asm/pgalloc.h>
 #include <asm/uaccess.h>
@@ -1926,6 +1927,8 @@ again:
 
 	/* The page isn't present yet, go ahead with the fault. */
 
+	page = check_migrate_misplaced_page(page, vma, address);
+
 	inc_mm_counter(mm, anon_rss);
 	pte = mk_pte(page, vma->vm_page_prot);
 	if (write_access && can_share_swap_page(page)) {

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>