diff options
author | Andrea Arcangeli <aarcange@redhat.com> | 2011-01-13 15:47:15 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 17:32:47 -0800 |
commit | 14d1a55cd26f1860f837f37ae42520c7c13b1347 (patch) | |
tree | b80634a6a2a5f306fd1c3fc408993dd9fc98202b /mm/memory.c | |
parent | 05b258e99725112c4febeab4fad23ea2c8908a3a (diff) |
thp: add debug checks for mapcount related invariants
Add debug checks for invariants that if broken could lead to mapcount vs
page_mapcount debug checks to trigger later in split_huge_page.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory.c')
-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 12ee1ea237f..31250faff39 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 next = pmd_addr_end(addr, end); if (pmd_trans_huge(*src_pmd)) { int err; + VM_BUG_ON(next-addr != HPAGE_PMD_SIZE); err = copy_huge_pmd(dst_mm, src_mm, dst_pmd, src_pmd, addr, vma); if (err == -ENOMEM) @@ -1015,9 +1016,10 @@ static inline unsigned long zap_pmd_range(struct mmu_gather *tlb, do { next = pmd_addr_end(addr, end); if (pmd_trans_huge(*pmd)) { - if (next-addr != HPAGE_PMD_SIZE) + if (next-addr != HPAGE_PMD_SIZE) { + VM_BUG_ON(!rwsem_is_locked(&tlb->mm->mmap_sem)); split_huge_page_pmd(vma->vm_mm, pmd); - else if (zap_huge_pmd(tlb, vma, pmd)) { + } else if (zap_huge_pmd(tlb, vma, pmd)) { (*zap_work)--; continue; } |