mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-07 23:11:27 +00:00
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>
This commit is contained in:
parent
05b258e997
commit
14d1a55cd2
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
next = pmd_addr_end(addr, end);
|
||||||
if (pmd_trans_huge(*src_pmd)) {
|
if (pmd_trans_huge(*src_pmd)) {
|
||||||
int err;
|
int err;
|
||||||
|
VM_BUG_ON(next-addr != HPAGE_PMD_SIZE);
|
||||||
err = copy_huge_pmd(dst_mm, src_mm,
|
err = copy_huge_pmd(dst_mm, src_mm,
|
||||||
dst_pmd, src_pmd, addr, vma);
|
dst_pmd, src_pmd, addr, vma);
|
||||||
if (err == -ENOMEM)
|
if (err == -ENOMEM)
|
||||||
|
@ -1015,9 +1016,10 @@ static inline unsigned long zap_pmd_range(struct mmu_gather *tlb,
|
||||||
do {
|
do {
|
||||||
next = pmd_addr_end(addr, end);
|
next = pmd_addr_end(addr, end);
|
||||||
if (pmd_trans_huge(*pmd)) {
|
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);
|
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)--;
|
(*zap_work)--;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue