aboutsummaryrefslogtreecommitdiffstats
path: root/mm/rmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/rmap.c')
-rw-r--r--mm/rmap.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index 10993942d6c9..53c56dacd725 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -50,6 +50,7 @@
50#include <linux/kallsyms.h> 50#include <linux/kallsyms.h>
51#include <linux/memcontrol.h> 51#include <linux/memcontrol.h>
52#include <linux/mmu_notifier.h> 52#include <linux/mmu_notifier.h>
53#include <linux/migrate.h>
53 54
54#include <asm/tlbflush.h> 55#include <asm/tlbflush.h>
55 56
@@ -818,8 +819,7 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
818 spin_unlock(&mmlist_lock); 819 spin_unlock(&mmlist_lock);
819 } 820 }
820 dec_mm_counter(mm, anon_rss); 821 dec_mm_counter(mm, anon_rss);
821#ifdef CONFIG_MIGRATION 822 } else if (PAGE_MIGRATION) {
822 } else {
823 /* 823 /*
824 * Store the pfn of the page in a special migration 824 * Store the pfn of the page in a special migration
825 * pte. do_swap_page() will wait until the migration 825 * pte. do_swap_page() will wait until the migration
@@ -827,19 +827,15 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
827 */ 827 */
828 BUG_ON(!migration); 828 BUG_ON(!migration);
829 entry = make_migration_entry(page, pte_write(pteval)); 829 entry = make_migration_entry(page, pte_write(pteval));
830#endif
831 } 830 }
832 set_pte_at(mm, address, pte, swp_entry_to_pte(entry)); 831 set_pte_at(mm, address, pte, swp_entry_to_pte(entry));
833 BUG_ON(pte_file(*pte)); 832 BUG_ON(pte_file(*pte));
834 } else 833 } else if (PAGE_MIGRATION && migration) {
835#ifdef CONFIG_MIGRATION
836 if (migration) {
837 /* Establish migration entry for a file page */ 834 /* Establish migration entry for a file page */
838 swp_entry_t entry; 835 swp_entry_t entry;
839 entry = make_migration_entry(page, pte_write(pteval)); 836 entry = make_migration_entry(page, pte_write(pteval));
840 set_pte_at(mm, address, pte, swp_entry_to_pte(entry)); 837 set_pte_at(mm, address, pte, swp_entry_to_pte(entry));
841 } else 838 } else
842#endif
843 dec_mm_counter(mm, file_rss); 839 dec_mm_counter(mm, file_rss);
844 840
845 841