From: Dave Hansen Date: Tue, 21 Jan 2014 23:48:48 +0000 (-0800) Subject: mm: hugetlbfs: Add some VM_BUG_ON()s to catch non-hugetlbfs pages X-Git-Tag: v3.14-rc1~134^2~88 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e147aed4c250766e657855db55a395d2c8008a5;p=kernel%2Fkernel-generic.git mm: hugetlbfs: Add some VM_BUG_ON()s to catch non-hugetlbfs pages Dave Jiang reported that he was seeing oopses when running NUMA systems and default_hugepagesz=1G. I traced the issue down to migrate_page_copy() trying to use the same code for hugetlb pages and transparent hugepages. It should not have been trying to pass thp pages in there. So, add some VM_BUG_ON()s for the next hapless VM developer that tries the same thing. Signed-off-by: Dave Hansen Reviewed-by: Naoya Horiguchi Tested-by: Dave Jiang Acked-by: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index bd7e987..251233c 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -360,6 +360,7 @@ static inline pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma, static inline struct hstate *page_hstate(struct page *page) { + VM_BUG_ON(!PageHuge(page)); return size_to_hstate(PAGE_SIZE << compound_order(page)); }