Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
[linux-2.6-block.git] / mm / rmap.c
index 8fc049f9a5a6c5d511ac7a5ac0dd41c698ed99a3..11cf322f8133d7048d414c6f0eed227f6b12d3ac 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1165,6 +1165,16 @@ int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
                }
                set_pte_at(mm, address, pte,
                           swp_entry_to_pte(make_hwpoison_entry(page)));
+       } else if (pte_unused(pteval)) {
+               /*
+                * The guest indicated that the page content is of no
+                * interest anymore. Simply discard the pte, vmscan
+                * will take care of the rest.
+                */
+               if (PageAnon(page))
+                       dec_mm_counter(mm, MM_ANONPAGES);
+               else
+                       dec_mm_counter(mm, MM_FILEPAGES);
        } else if (PageAnon(page)) {
                swp_entry_t entry = { .val = page_private(page) };
                pte_t swp_pte;