aboutsummaryrefslogtreecommitdiffstats
path: root/mm/rmap.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2006-06-23 05:03:38 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-23 10:42:51 -0400
commit04e62a29bf157ce1edd168f2b71b533c80d13628 (patch)
tree7f0d5a58eeef2c2e08da86dc7141a1ccd050a37d /mm/rmap.c
parent442c9137de8d769053e81d325709dca72f0b5e44 (diff)
[PATCH] More page migration: use migration entries for file pages
This implements the use of migration entries to preserve ptes of file backed pages during migration. Processes can therefore be migrated back and forth without loosing their connection to pagecache pages. Note that we implement the migration entries only for linear mappings. Nonlinear mappings still require the unmapping of the ptes for migration. And another writepage() ugliness shows up. writepage() can drop the page lock. Therefore we have to remove migration ptes before calling writepages() in order to avoid having migration entries point to unlocked pages. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/rmap.c')
-rw-r--r--mm/rmap.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index 05d6d73a692d..882a85826bb2 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -596,6 +596,7 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
596 spin_unlock(&mmlist_lock); 596 spin_unlock(&mmlist_lock);
597 } 597 }
598 dec_mm_counter(mm, anon_rss); 598 dec_mm_counter(mm, anon_rss);
599#ifdef CONFIG_MIGRATION
599 } else { 600 } else {
600 /* 601 /*
601 * Store the pfn of the page in a special migration 602 * Store the pfn of the page in a special migration
@@ -604,12 +605,22 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
604 */ 605 */
605 BUG_ON(!migration); 606 BUG_ON(!migration);
606 entry = make_migration_entry(page, pte_write(pteval)); 607 entry = make_migration_entry(page, pte_write(pteval));
608#endif
607 } 609 }
608 set_pte_at(mm, address, pte, swp_entry_to_pte(entry)); 610 set_pte_at(mm, address, pte, swp_entry_to_pte(entry));
609 BUG_ON(pte_file(*pte)); 611 BUG_ON(pte_file(*pte));
610 } else 612 } else
613#ifdef CONFIG_MIGRATION
614 if (migration) {
615 /* Establish migration entry for a file page */
616 swp_entry_t entry;
617 entry = make_migration_entry(page, pte_write(pteval));
618 set_pte_at(mm, address, pte, swp_entry_to_pte(entry));
619 } else
620#endif
611 dec_mm_counter(mm, file_rss); 621 dec_mm_counter(mm, file_rss);
612 622
623
613 page_remove_rmap(page); 624 page_remove_rmap(page);
614 page_cache_release(page); 625 page_cache_release(page);
615 626