hugetlb, rmap: use hugepage_add_new_anon_rmap() in hugetlb_cow()
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Fri, 10 Sep 2010 04:23:04 +0000 (13:23 +0900)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Sep 2010 00:29:18 +0000 (17:29 -0700)
Obviously, setting anon_vma for COWed hugepage should be done
by hugepage_add_new_anon_rmap() to scan vmas faster.
This patch fixes it.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Acked-by: Andrea Arcangeli <aarcange@redhat.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/hugetlb.c

index cc5be788a39fe132c72cbc1d2fb1c03f71708575..9519f3f6c1dad950e89c196a331d93fc7df2c672 100644 (file)
@@ -2404,7 +2404,7 @@ retry_avoidcopy:
                set_huge_pte_at(mm, address, ptep,
                                make_huge_pte(vma, new_page, 1));
                page_remove_rmap(old_page);
-               hugepage_add_anon_rmap(new_page, vma, address);
+               hugepage_add_new_anon_rmap(new_page, vma, address);
                /* Make the old page be freed below */
                new_page = old_page;
                mmu_notifier_invalidate_range_end(mm,