diff options
author | Olof Johansson <olof@lixom.net> | 2012-02-07 18:04:15 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-02-07 18:05:20 -0500 |
commit | a5f17d1f4c2831b9b9bf8b1a537cdbac995d6e13 (patch) | |
tree | cce7eab28de00a88d75b8eda704f5838e10947b1 /mm/hugetlb.c | |
parent | dcf81c1af839b77b44404453ecae6e5ac5a75f05 (diff) | |
parent | 62aa2b537c6f5957afd98e29f96897419ed5ebab (diff) |
Merge tag 'v3.3-rc2' into depends/rmk/for-armsoc
There were conflicts between fixes going in after 3.3-rc1 and
Russell's stable arm-soc base branch. Resolving it in the dependency
branch so that each topic branch shares the same resolution.
Conflicts:
arch/arm/mach-at91/at91cap9.c
arch/arm/mach-at91/at91sam9g45.c
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r-- | mm/hugetlb.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index ea8c3a4cd2a..5f34bd8dda3 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -2508,6 +2508,7 @@ static int hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
2508 | { | 2508 | { |
2509 | struct hstate *h = hstate_vma(vma); | 2509 | struct hstate *h = hstate_vma(vma); |
2510 | int ret = VM_FAULT_SIGBUS; | 2510 | int ret = VM_FAULT_SIGBUS; |
2511 | int anon_rmap = 0; | ||
2511 | pgoff_t idx; | 2512 | pgoff_t idx; |
2512 | unsigned long size; | 2513 | unsigned long size; |
2513 | struct page *page; | 2514 | struct page *page; |
@@ -2562,14 +2563,13 @@ retry: | |||
2562 | spin_lock(&inode->i_lock); | 2563 | spin_lock(&inode->i_lock); |
2563 | inode->i_blocks += blocks_per_huge_page(h); | 2564 | inode->i_blocks += blocks_per_huge_page(h); |
2564 | spin_unlock(&inode->i_lock); | 2565 | spin_unlock(&inode->i_lock); |
2565 | page_dup_rmap(page); | ||
2566 | } else { | 2566 | } else { |
2567 | lock_page(page); | 2567 | lock_page(page); |
2568 | if (unlikely(anon_vma_prepare(vma))) { | 2568 | if (unlikely(anon_vma_prepare(vma))) { |
2569 | ret = VM_FAULT_OOM; | 2569 | ret = VM_FAULT_OOM; |
2570 | goto backout_unlocked; | 2570 | goto backout_unlocked; |
2571 | } | 2571 | } |
2572 | hugepage_add_new_anon_rmap(page, vma, address); | 2572 | anon_rmap = 1; |
2573 | } | 2573 | } |
2574 | } else { | 2574 | } else { |
2575 | /* | 2575 | /* |
@@ -2582,7 +2582,6 @@ retry: | |||
2582 | VM_FAULT_SET_HINDEX(h - hstates); | 2582 | VM_FAULT_SET_HINDEX(h - hstates); |
2583 | goto backout_unlocked; | 2583 | goto backout_unlocked; |
2584 | } | 2584 | } |
2585 | page_dup_rmap(page); | ||
2586 | } | 2585 | } |
2587 | 2586 | ||
2588 | /* | 2587 | /* |
@@ -2606,6 +2605,10 @@ retry: | |||
2606 | if (!huge_pte_none(huge_ptep_get(ptep))) | 2605 | if (!huge_pte_none(huge_ptep_get(ptep))) |
2607 | goto backout; | 2606 | goto backout; |
2608 | 2607 | ||
2608 | if (anon_rmap) | ||
2609 | hugepage_add_new_anon_rmap(page, vma, address); | ||
2610 | else | ||
2611 | page_dup_rmap(page); | ||
2609 | new_pte = make_huge_pte(vma, page, ((vma->vm_flags & VM_WRITE) | 2612 | new_pte = make_huge_pte(vma, page, ((vma->vm_flags & VM_WRITE) |
2610 | && (vma->vm_flags & VM_SHARED))); | 2613 | && (vma->vm_flags & VM_SHARED))); |
2611 | set_huge_pte_at(mm, address, ptep, new_pte); | 2614 | set_huge_pte_at(mm, address, ptep, new_pte); |