aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/hugetlb.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index a13be48b818b..da027a3307af 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2528,7 +2528,6 @@ static int hugetlb_cow(struct mm_struct *mm, struct vm_area_struct *vma,
2528{ 2528{
2529 struct hstate *h = hstate_vma(vma); 2529 struct hstate *h = hstate_vma(vma);
2530 struct page *old_page, *new_page; 2530 struct page *old_page, *new_page;
2531 int avoidcopy;
2532 int outside_reserve = 0; 2531 int outside_reserve = 0;
2533 unsigned long mmun_start; /* For mmu_notifiers */ 2532 unsigned long mmun_start; /* For mmu_notifiers */
2534 unsigned long mmun_end; /* For mmu_notifiers */ 2533 unsigned long mmun_end; /* For mmu_notifiers */
@@ -2538,10 +2537,8 @@ static int hugetlb_cow(struct mm_struct *mm, struct vm_area_struct *vma,
2538retry_avoidcopy: 2537retry_avoidcopy:
2539 /* If no-one else is actually using this page, avoid the copy 2538 /* If no-one else is actually using this page, avoid the copy
2540 * and just make the page writable */ 2539 * and just make the page writable */
2541 avoidcopy = (page_mapcount(old_page) == 1); 2540 if (page_mapcount(old_page) == 1 && PageAnon(old_page)) {
2542 if (avoidcopy) { 2541 page_move_anon_rmap(old_page, vma, address);
2543 if (PageAnon(old_page))
2544 page_move_anon_rmap(old_page, vma, address);
2545 set_huge_ptep_writable(vma, address, ptep); 2542 set_huge_ptep_writable(vma, address, ptep);
2546 return 0; 2543 return 0;
2547 } 2544 }