aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/rmap.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index 1963e269314d..10806b7af40c 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -578,7 +578,7 @@ void page_remove_rmap(struct page *page)
578 * repeatedly from either try_to_unmap_anon or try_to_unmap_file. 578 * repeatedly from either try_to_unmap_anon or try_to_unmap_file.
579 */ 579 */
580static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma, 580static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
581 int ignore_refs) 581 int migration)
582{ 582{
583 struct mm_struct *mm = vma->vm_mm; 583 struct mm_struct *mm = vma->vm_mm;
584 unsigned long address; 584 unsigned long address;
@@ -602,7 +602,7 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
602 */ 602 */
603 if ((vma->vm_flags & VM_LOCKED) || 603 if ((vma->vm_flags & VM_LOCKED) ||
604 (ptep_clear_flush_young(vma, address, pte) 604 (ptep_clear_flush_young(vma, address, pte)
605 && !ignore_refs)) { 605 && !migration)) {
606 ret = SWAP_FAIL; 606 ret = SWAP_FAIL;
607 goto out_unmap; 607 goto out_unmap;
608 } 608 }
@@ -736,7 +736,7 @@ static void try_to_unmap_cluster(unsigned long cursor,
736 pte_unmap_unlock(pte - 1, ptl); 736 pte_unmap_unlock(pte - 1, ptl);
737} 737}
738 738
739static int try_to_unmap_anon(struct page *page, int ignore_refs) 739static int try_to_unmap_anon(struct page *page, int migration)
740{ 740{
741 struct anon_vma *anon_vma; 741 struct anon_vma *anon_vma;
742 struct vm_area_struct *vma; 742 struct vm_area_struct *vma;
@@ -747,7 +747,7 @@ static int try_to_unmap_anon(struct page *page, int ignore_refs)
747 return ret; 747 return ret;
748 748
749 list_for_each_entry(vma, &anon_vma->head, anon_vma_node) { 749 list_for_each_entry(vma, &anon_vma->head, anon_vma_node) {
750 ret = try_to_unmap_one(page, vma, ignore_refs); 750 ret = try_to_unmap_one(page, vma, migration);
751 if (ret == SWAP_FAIL || !page_mapped(page)) 751 if (ret == SWAP_FAIL || !page_mapped(page))
752 break; 752 break;
753 } 753 }
@@ -764,7 +764,7 @@ static int try_to_unmap_anon(struct page *page, int ignore_refs)
764 * 764 *
765 * This function is only called from try_to_unmap for object-based pages. 765 * This function is only called from try_to_unmap for object-based pages.
766 */ 766 */
767static int try_to_unmap_file(struct page *page, int ignore_refs) 767static int try_to_unmap_file(struct page *page, int migration)
768{ 768{
769 struct address_space *mapping = page->mapping; 769 struct address_space *mapping = page->mapping;
770 pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); 770 pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
@@ -778,7 +778,7 @@ static int try_to_unmap_file(struct page *page, int ignore_refs)
778 778
779 spin_lock(&mapping->i_mmap_lock); 779 spin_lock(&mapping->i_mmap_lock);
780 vma_prio_tree_foreach(vma, &iter, &mapping->i_mmap, pgoff, pgoff) { 780 vma_prio_tree_foreach(vma, &iter, &mapping->i_mmap, pgoff, pgoff) {
781 ret = try_to_unmap_one(page, vma, ignore_refs); 781 ret = try_to_unmap_one(page, vma, migration);
782 if (ret == SWAP_FAIL || !page_mapped(page)) 782 if (ret == SWAP_FAIL || !page_mapped(page))
783 goto out; 783 goto out;
784 } 784 }
@@ -863,16 +863,16 @@ out:
863 * SWAP_AGAIN - we missed a mapping, try again later 863 * SWAP_AGAIN - we missed a mapping, try again later
864 * SWAP_FAIL - the page is unswappable 864 * SWAP_FAIL - the page is unswappable
865 */ 865 */
866int try_to_unmap(struct page *page, int ignore_refs) 866int try_to_unmap(struct page *page, int migration)
867{ 867{
868 int ret; 868 int ret;
869 869
870 BUG_ON(!PageLocked(page)); 870 BUG_ON(!PageLocked(page));
871 871
872 if (PageAnon(page)) 872 if (PageAnon(page))
873 ret = try_to_unmap_anon(page, ignore_refs); 873 ret = try_to_unmap_anon(page, migration);
874 else 874 else
875 ret = try_to_unmap_file(page, ignore_refs); 875 ret = try_to_unmap_file(page, migration);
876 876
877 if (!page_mapped(page)) 877 if (!page_mapped(page))
878 ret = SWAP_SUCCESS; 878 ret = SWAP_SUCCESS;