From: Kirill A. Shutemov Date: Wed, 4 Jun 2014 23:06:57 +0000 (-0700) Subject: thp: consolidate assert checks in __split_huge_page() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ff9e43eb4f2eb78067d7b783cc893773b3e129b1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Andrea Arcangeli Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/huge_memory.c b/mm/huge_memory.c index d199d2d91946..2434d9059e5c 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1830,10 +1830,11 @@ static void __split_huge_page(struct page *page, * the newly established pmd of the child later during the * walk, to be able to set it as pmd_trans_splitting too. */ - if (mapcount != page_mapcount(page)) + if (mapcount != page_mapcount(page)) { printk(KERN_ERR "mapcount %d page_mapcount %d\n", mapcount, page_mapcount(page)); - BUG_ON(mapcount != page_mapcount(page)); + BUG(); + } __split_huge_page_refcount(page, list); @@ -1844,10 +1845,11 @@ static void __split_huge_page(struct page *page, BUG_ON(is_vma_temporary_stack(vma)); mapcount2 += __split_huge_page_map(page, vma, addr); } - if (mapcount != mapcount2) + if (mapcount != mapcount2) { printk(KERN_ERR "mapcount %d mapcount2 %d page_mapcount %d\n", mapcount, mapcount2, page_mapcount(page)); - BUG_ON(mapcount != mapcount2); + BUG(); + } } /*