X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=mm%2Frmap.c;h=89770bd25f31be71877813a292793fcc62e01116;hb=ca775c629a366ded01aae69da8410f70aaf85de1;hp=9827409eb7c7ea4026e27b34fdaceacd909cabc3;hpb=befc9e10d64f93472aff0b0280968f447f5402df;p=powerpc.git diff --git a/mm/rmap.c b/mm/rmap.c index 9827409eb7..89770bd25f 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -539,27 +539,6 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma) goto out_unmap; } - /* - * Don't pull an anonymous page out from under get_user_pages. - * GUP carefully breaks COW and raises page count (while holding - * page_table_lock, as we have here) to make sure that the page - * cannot be freed. If we unmap that page here, a user write - * access to the virtual address will bring back the page, but - * its raised count will (ironically) be taken to mean it's not - * an exclusive swap page, do_wp_page will replace it by a copy - * page, and the user never get to see the data GUP was holding - * the original page for. - * - * This test is also useful for when swapoff (unuse_process) has - * to drop page lock: its reference to the page stops existing - * ptes from being unmapped, so swapoff can make progress. - */ - if (PageSwapCache(page) && - page_count(page) != page_mapcount(page) + 2) { - ret = SWAP_FAIL; - goto out_unmap; - } - /* Nuke the page table entry. */ flush_cache_page(vma, address, page_to_pfn(page)); pteval = ptep_clear_flush(vma, address, pte);