]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/rmap.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[karo-tx-linux.git] / mm / rmap.c
index a53a10b93ecffd53072ae7193df6338500313dac..882a85826bb2d2c6cf5ef61ee7d3fb982b125e9b 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -595,6 +595,8 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
                                        list_add(&mm->mmlist, &init_mm.mmlist);
                                spin_unlock(&mmlist_lock);
                        }
+                       dec_mm_counter(mm, anon_rss);
+#ifdef CONFIG_MIGRATION
                } else {
                        /*
                         * Store the pfn of the page in a special migration
@@ -603,13 +605,22 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
                         */
                        BUG_ON(!migration);
                        entry = make_migration_entry(page, pte_write(pteval));
+#endif
                }
                set_pte_at(mm, address, pte, swp_entry_to_pte(entry));
                BUG_ON(pte_file(*pte));
-               dec_mm_counter(mm, anon_rss);
        } else
+#ifdef CONFIG_MIGRATION
+       if (migration) {
+               /* Establish migration entry for a file page */
+               swp_entry_t entry;
+               entry = make_migration_entry(page, pte_write(pteval));
+               set_pte_at(mm, address, pte, swp_entry_to_pte(entry));
+       } else
+#endif
                dec_mm_counter(mm, file_rss);
 
+
        page_remove_rmap(page);
        page_cache_release(page);