mm/memory.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mm/memory.c b/mm/memory.c index 49fb1cf08611..f5ec3ae03f44 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3715,6 +3715,18 @@ retry: return do_huge_pmd_numa_page(mm, vma, address, orig_pmd, pmd); + /* + * If the pmd is splitting, return and retry the + * the fault. We *could* set just the accessed flag, + * but it's better to just avoid the races with + * splitting entirely. + * + * Alternative: wait until the split is done, and + * goto retry. + */ + if (pmd_trans_splitting(orig_pmd)) + return 0; + if (dirty && !pmd_write(orig_pmd)) { ret = do_huge_pmd_wp_page(mm, vma, address, pmd, orig_pmd);