diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/memory.c b/mm/memory.c index 12ee1ea237f5..31250faff390 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -804,6 +804,7 @@ static inline int copy_pmd_range(struct mm_struct *dst_mm, struct mm_struct *src | |||
804 | next = pmd_addr_end(addr, end); | 804 | next = pmd_addr_end(addr, end); |
805 | if (pmd_trans_huge(*src_pmd)) { | 805 | if (pmd_trans_huge(*src_pmd)) { |
806 | int err; | 806 | int err; |
807 | VM_BUG_ON(next-addr != HPAGE_PMD_SIZE); | ||
807 | err = copy_huge_pmd(dst_mm, src_mm, | 808 | err = copy_huge_pmd(dst_mm, src_mm, |
808 | dst_pmd, src_pmd, addr, vma); | 809 | dst_pmd, src_pmd, addr, vma); |
809 | if (err == -ENOMEM) | 810 | if (err == -ENOMEM) |
@@ -1015,9 +1016,10 @@ static inline unsigned long zap_pmd_range(struct mmu_gather *tlb, | |||
1015 | do { | 1016 | do { |
1016 | next = pmd_addr_end(addr, end); | 1017 | next = pmd_addr_end(addr, end); |
1017 | if (pmd_trans_huge(*pmd)) { | 1018 | if (pmd_trans_huge(*pmd)) { |
1018 | if (next-addr != HPAGE_PMD_SIZE) | 1019 | if (next-addr != HPAGE_PMD_SIZE) { |
1020 | VM_BUG_ON(!rwsem_is_locked(&tlb->mm->mmap_sem)); | ||
1019 | split_huge_page_pmd(vma->vm_mm, pmd); | 1021 | split_huge_page_pmd(vma->vm_mm, pmd); |
1020 | else if (zap_huge_pmd(tlb, vma, pmd)) { | 1022 | } else if (zap_huge_pmd(tlb, vma, pmd)) { |
1021 | (*zap_work)--; | 1023 | (*zap_work)--; |
1022 | continue; | 1024 | continue; |
1023 | } | 1025 | } |