When the hugepage associated with a given address is HWPOISONed or under page migration, get_user_pages_fast() need to fall back to slow path in order to make the page fault fail (when HWPOISONed) or to wait for migration completion (when under migration.) Signed-off-by: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx> --- arch/x86/mm/gup.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git v2.6.38-rc1/arch/x86/mm/gup.c v2.6.38-rc1/arch/x86/mm/gup.c index dbe34b9..93b74dd 100644 --- v2.6.38-rc1/arch/x86/mm/gup.c +++ v2.6.38-rc1/arch/x86/mm/gup.c @@ -176,6 +176,15 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end, */ if (pmd_none(pmd) || pmd_trans_splitting(pmd)) return 0; + /* + * PMD can be in swap entry style when the hugepage + * pointed to by it is hwpoisoned or under migration. + * Because the swap entry format has no flag showing + * the page size, pmd_large() cannot detect it. + * So then we just fall back to the slow path. + */ + if (unlikely(!pmd_present(pmd))) + return 0; if (unlikely(pmd_large(pmd))) { if (!gup_huge_pmd(pmd, addr, next, write, pages, nr)) return 0; -- 1.7.3.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>