Index: linux-2.6.10-rc2-mm4-page-migration-only/include/linux/mmigrate.h =================================================================== --- linux-2.6.10-rc2-mm4-page-migration-only.orig/include/linux/mmigrate.h 2004-12-23 17:04:41.000000000 -0800 +++ linux-2.6.10-rc2-mm4-page-migration-only/include/linux/mmigrate.h 2005-01-04 07:23:36.000000000 -0800 @@ -4,6 +4,7 @@ #include #include +#define MIGRATE_NODE_ANY -1 #ifdef CONFIG_MEMORY_MIGRATE extern int generic_migrate_page(struct page *, struct page *, @@ -14,7 +15,7 @@ extern int migrate_page_buffer(struct pa struct list_head *); extern int page_migratable(struct page *, struct page *, int, struct list_head *); -extern struct page * migrate_onepage(struct page *); +extern struct page * migrate_onepage(struct page *, int nodeid); extern int try_to_migrate_pages(struct list_head *); #else Index: linux-2.6.10-rc2-mm4-page-migration-only/mm/mmigrate.c =================================================================== --- linux-2.6.10-rc2-mm4-page-migration-only.orig/mm/mmigrate.c 2005-01-04 07:09:24.000000000 -0800 +++ linux-2.6.10-rc2-mm4-page-migration-only/mm/mmigrate.c 2005-01-04 07:30:57.000000000 -0800 @@ -404,7 +404,7 @@ out_removing: * swapcache or anonymous memory. */ struct page * -migrate_onepage(struct page *page) +migrate_onepage(struct page *page, int nodeid) { struct page *newpage; struct address_space *mapping; @@ -434,7 +434,10 @@ migrate_onepage(struct page *page) * Allocate a new page with the same gfp_mask * as the target page has. */ - newpage = page_cache_alloc(mapping, page->index); + if (nodeid == MIGRATE_NODE_ANY) + newpage = page_cache_alloc(mapping, page->index); + else + newpage = alloc_pages_node(nodeid, mapping->flags, 0); if (newpage == NULL) { unlock_page(page); return ERR_PTR(-ENOMEM); @@ -538,7 +541,7 @@ int try_to_migrate_pages(struct list_hea list_for_each_entry_safe(page, page2, &pass1_list, lru) { list_del(&page->lru); if (PageLocked(page) || PageWriteback(page) || - IS_ERR(newpage = migrate_onepage(page))) { + IS_ERR(newpage = migrate_onepage(page, MIGRATE_NODE_ANY))) { if (page_count(page) == 1) { /* the page is already unused */ putback_page_to_lru(page_zone(page), page); @@ -556,7 +559,7 @@ int try_to_migrate_pages(struct list_hea */ list_for_each_entry_safe(page, page2, &pass2_list, lru) { list_del(&page->lru); - if (IS_ERR(newpage = migrate_onepage(page))) { + if (IS_ERR(newpage = migrate_onepage(page, MIGRATE_NODE_ANY))) { if (page_count(page) == 1) { /* the page is already unused */ putback_page_to_lru(page_zone(page), page); @@ -586,4 +589,4 @@ EXPORT_SYMBOL(generic_migrate_page); EXPORT_SYMBOL(migrate_page_common); EXPORT_SYMBOL(migrate_page_buffer); EXPORT_SYMBOL(page_migratable); - +EXPORT_SYMBOL(migrate_onepage);