aboutsummaryrefslogtreecommitdiffstats
path: root/mm/huge_memory.c
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2014-06-04 19:06:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 19:53:57 -0400
commitff9e43eb4f2eb78067d7b783cc893773b3e129b1 (patch)
treefa4194211a8a0523d5123507556b1855644a0a01 /mm/huge_memory.c
parent38f7ea5a082bbde9e64b7ece389f20e71a9806f4 (diff)
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>
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r--mm/huge_memory.c10
1 files changed, 6 insertions, 4 deletions
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,
1830 * the newly established pmd of the child later during the 1830 * the newly established pmd of the child later during the
1831 * walk, to be able to set it as pmd_trans_splitting too. 1831 * walk, to be able to set it as pmd_trans_splitting too.
1832 */ 1832 */
1833 if (mapcount != page_mapcount(page)) 1833 if (mapcount != page_mapcount(page)) {
1834 printk(KERN_ERR "mapcount %d page_mapcount %d\n", 1834 printk(KERN_ERR "mapcount %d page_mapcount %d\n",
1835 mapcount, page_mapcount(page)); 1835 mapcount, page_mapcount(page));
1836 BUG_ON(mapcount != page_mapcount(page)); 1836 BUG();
1837 }
1837 1838
1838 __split_huge_page_refcount(page, list); 1839 __split_huge_page_refcount(page, list);
1839 1840
@@ -1844,10 +1845,11 @@ static void __split_huge_page(struct page *page,
1844 BUG_ON(is_vma_temporary_stack(vma)); 1845 BUG_ON(is_vma_temporary_stack(vma));
1845 mapcount2 += __split_huge_page_map(page, vma, addr); 1846 mapcount2 += __split_huge_page_map(page, vma, addr);
1846 } 1847 }
1847 if (mapcount != mapcount2) 1848 if (mapcount != mapcount2) {
1848 printk(KERN_ERR "mapcount %d mapcount2 %d page_mapcount %d\n", 1849 printk(KERN_ERR "mapcount %d mapcount2 %d page_mapcount %d\n",
1849 mapcount, mapcount2, page_mapcount(page)); 1850 mapcount, mapcount2, page_mapcount(page));
1850 BUG_ON(mapcount != mapcount2); 1851 BUG();
1852 }
1851} 1853}
1852 1854
1853/* 1855/*