Skip to content

Commit ff9e43e

Browse files
kiryltorvalds
authored andcommitted
thp: consolidate assert checks in __split_huge_page()
It doesn't make sense to have two assert checks for each invariant: one for printing and one for BUG(). Let's trigger BUG() if we print error message. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 38f7ea5 commit ff9e43e

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎mm/huge_memory.c‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,10 +1830,11 @@ static void __split_huge_page(struct page *page,
18301830
* the newly established pmd of the child later during the
18311831
* walk, to be able to set it as pmd_trans_splitting too.
18321832
*/
1833-
if (mapcount != page_mapcount(page))
1833+
if (mapcount != page_mapcount(page)) {
18341834
printk(KERN_ERR "mapcount %d page_mapcount %d\n",
18351835
mapcount, page_mapcount(page));
1836-
BUG_ON(mapcount != page_mapcount(page));
1836+
BUG();
1837+
}
18371838

18381839
__split_huge_page_refcount(page, list);
18391840

@@ -1844,10 +1845,11 @@ static void __split_huge_page(struct page *page,
18441845
BUG_ON(is_vma_temporary_stack(vma));
18451846
mapcount2 += __split_huge_page_map(page, vma, addr);
18461847
}
1847-
if (mapcount != mapcount2)
1848+
if (mapcount != mapcount2) {
18481849
printk(KERN_ERR "mapcount %d mapcount2 %d page_mapcount %d\n",
18491850
mapcount, mapcount2, page_mapcount(page));
1850-
BUG_ON(mapcount != mapcount2);
1851+
BUG();
1852+
}
18511853
}
18521854

18531855
/*

0 commit comments

Comments
 (0)