aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mremap.c
diff options
context:
space:
mode:
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>2016-07-26 18:24:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-26 19:19:19 -0400
commit337d9abf1cd1a59645d91b6d0b1685a476b81978 (patch)
treeaace71b1608dfbde1c4c35bd03cbdac60fe1f64a /mm/mremap.c
parente3a2713c3cfa9c41fac57447533079d8da23319b (diff)
mm: thp: check pmd_trans_unstable() after split_huge_pmd()
split_huge_pmd() doesn't guarantee that the pmd is normal pmd pointing to pte entries, which can be checked with pmd_trans_unstable(). Some callers make this assertion and some do it differently and some not, so let's do it in a unified manner. Link: http://lkml.kernel.org/r/1464741400-12143-1-git-send-email-n-horiguchi@ah.jp.nec.com Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: "Kirill A. Shutemov" <kirill@shutemov.name> Cc: Hugh Dickins <hughd@google.com> Cc: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mremap.c')
-rw-r--r--mm/mremap.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/mremap.c b/mm/mremap.c
index 1f157adfdaf9..da22ad2a5678 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -210,9 +210,8 @@ unsigned long move_page_tables(struct vm_area_struct *vma,
210 } 210 }
211 } 211 }
212 split_huge_pmd(vma, old_pmd, old_addr); 212 split_huge_pmd(vma, old_pmd, old_addr);
213 if (pmd_none(*old_pmd)) 213 if (pmd_trans_unstable(old_pmd))
214 continue; 214 continue;
215 VM_BUG_ON(pmd_trans_huge(*old_pmd));
216 } 215 }
217 if (pte_alloc(new_vma->vm_mm, new_pmd, new_addr)) 216 if (pte_alloc(new_vma->vm_mm, new_pmd, new_addr))
218 break; 217 break;