Hugh Dickins wrote: > Occasionally we hit the BUG_ON(pmd_trans_huge(*pmd)) at the end of > __split_huge_page_pmd(): seen when doing madvise(,,MADV_DONTNEED). > > It's invalid: we don't always have down_write of mmap_sem there: > a racing do_huge_pmd_wp_page() might have copied-on-write to another > huge page before our split_huge_page() got the anon_vma lock. > > Forget the BUG_ON, just go back and try again if this happens. > > Signed-off-by: Hugh Dickins <hughd@xxxxxxxxxx> > Cc: stable@xxxxxxxxxxxxxxx Looks reasonable to me. Acked-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> madvise(MADV_DONTNEED) was aproblematic with THP before. Is a big win having mmap_sem taken on read rather than on write for it? -- Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>